elasticsearch phrase suggester 得不到任何结果,小白想请教一下
資深大佬 : SjwNo1 13
- index 配置
settings:
"settings": { "index": { "creation_date": "1607592412988", "number_of_shards": "1", "number_of_replicas": "1", "uuid": "L_Z-Y-YlRiWiD5gnPWftSg", "version": {"created": "7090299"}, "provided_name": "repository_index", } }
mappings:
"mappings": { "_doc": { "properties": { "type_num": {"type": "integer"}, "creator_id": {"type": "integer"}, "name": {"analyzer": "ik_max_word", "type": "text"}, "team_id": {"type": "integer"}, } } }
- 文档数据(只有 1 条)
{ "_index": "repository_index", "_type": "_doc", "_id": "1", "_version": 1, "_score": 1, "_source": {"creator_id": 6, "team_id": 2, "type_num": 2, "name": "测试数据"}, }
- phrase suggest
POST _search { "suggest": { "my_suggestion": { "text": "测试", "term": { "field": "name" } } } }
- 搜索结果
{ "took" : 1, "timed_out" : false, "_shards" : { "total" : 6, "successful" : 6, "skipped" : 0, "failed" : 0 }, "hits" : { "total" : { "value" : 0, "relation" : "eq" }, "max_score" : null, "hits" : [ ] }, "suggest" : { "my_suggestion" : [ { "text" : "测试", "offset" : 0, "length" : 2, "options" : [ ] } ] } }
- 问题
没有查询到 “测试数据”? 目前猜测是 ik 分词的问题,请教一下是哪里出错了或者配置有问题吗
大佬有話說 (0)