美文网首页
使用Kibana 创建索引并设置IK分词

使用Kibana 创建索引并设置IK分词

作者: 索性流年 | 来源:发表于2021-03-25 09:17 被阅读0次

文章合集

其他 ES 相关文章

创建索引

PUT /device_model_index_test/
{
    "mappings": {
        "properties": {
            "deviceKeyword": {
                "index": true, 
                "type": "text", 
                "analyzer": "ik_max_word", 
                "search_analyzer": "ik_max_word"
            }, 
            "deviceId": {
                "index": false, 
                "type": "keyword"
            }
        }
    }
}

插入索引数据

  • PUT /索引/_doc/文档id
PUT /device_model_index_test/_doc/1
{
  "deviceKeyword":"测试索引文档",
  "deviceId" : "4"
}

分词查询

GET device_model_index_test/_search
{
    "query": {
        "match": {
            "deviceKeyword": "测试"
        }
    }
}

查询索引类型

GET device_model_index

复制当前索引内容到指定索引中

POST _reindex
{
  "source": {
    "index": "device_model_index"
  },
  "dest": {
    "index": "device_model_index0415"
  }
}

查询索引所有数据

GET device_model_index_test/_search

删除指定文档

DELETE device_model_index_test/_doc/7V58Y3gB1UfhVgQBiHYc

删除索引

DELETE device_model_index_test

相关文章

网友评论

      本文标题:使用Kibana 创建索引并设置IK分词

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