美文网首页
es7.x入门

es7.x入门

作者: cifer_pan | 来源:发表于2023-05-03 14:14 被阅读0次

查询所有索引

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" 
        }
    }

相关文章

网友评论

      本文标题:es7.x入门

      本文链接:https://www.haomeiwen.com/subject/tpctsdtx.html