es7.x入门

查询所有索引

GET _cat/indices

查看索引结构

GET /test-index

根据id 查询

GET /test-index/_search
{
  "query":{
    "match":{ 
      "id":300010688
    }
  } 
}

添加字段

PUT /test-index/_mapping/test-index
{
    "properties": {
        "dasdsa": {
            "type": "integer"
        }
    }
}

修改一个属性


POST /test-index/test-index/300010688/_update
{
  "doc":{
    "transCount":999
  }
}

创建索引

PUT /test-index
{"settings": {
      "index": { 
        "number_of_shards": "1",
        "number_of_replicas": "0" 
      }
    },
    "mappings":{
        "album-index":{
            "properties":{
                "albumPic":{
                     "type":"keyword"
                },
                "blockIds":{
                    "type":"long"
                },
                "circulationCount":{
                    "type":"long"
                },
                "createTime":{
                    "type":"date",
                    "format":"yyyy-MM-dd HH:mm:ss||epoch_millis"
                },
                "name":{
                    "type":"text",
                    "analyzer":"ik_max_word"
                } 
            }
        }
    }
}

删除索引

DELETE /test-index

复制索引数据


POST _reindex
{
        "source": {
            "index": "test-indextmp" 
        },
        "dest": {
            "index": "test-index" 
        }
    }
最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容