首页 > Elasticsearch ik插件如果能精准查中文?

Elasticsearch ik插件如果能精准查中文?

Elasticsearch(ik)中生成了以下索引
例结构如下例

      array(5) {
        ["_index"]=>
        string(10) "n_index"
        ["_type"]=>
        string(9) "n_type"
        ["_id"]=>
        string(20) "AVXdrZDVceqO8Q-vidP2"
        ["_score"]=>
        float(0.5171687)
        ["_source"]=>
        array(5) {
          ["id"]=>
          int(111)
          ["title"]=>
          string(82) "北京16款现代300顶级配置"
        }
      }```
      
      
比如我建了好多这样的索引
title字段列表如下
"北京16款现代300顶级配置"
"16款现代300北京顶级配置"
"北京16款起亚顶级配置"
"北京16款300顶级配置"
。。。


如何能实现查询结果返回以下几条


"北京16款现代300顶级配置"
"16款现代300北京顶级配置"

GET /_search
{
    "query": {
        "match_phrase": {  //match分词搜索命中 match_phrase分词全匹配
            "title": "北京16款现代300顶级配置"
        }
    }
}

这个结构化查询试试



目前按https://github.com/medcl/elasticsearch-analysis-ik 的示例能找到分词中分出的关键词,但是比如 我添加的curl -XPOST http://localhost:9200/index/fulltext/4 -d'
{"content":"中国驻洛杉矶领事馆遭亚裔男子枪击 嫌犯已自首"}
'
这行我想通过"中国男子"查到,这个es能实现吗?是需要特殊配置还是(就例子这个配置实现不了)

【热门文章】
【热门文章】