elasticsearch phrase suggester 得不到任何结果,小白想请教一下

2020-12-10 17:35:21 +08:00
 SjwNo1
"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"},
            }
        }
    }
{
    "_index": "repository_index",
    "_type": "_doc",
    "_id": "1",
    "_version": 1,
    "_score": 1,
    "_source": {"creator_id": 6, "team_id": 2, "type_num": 2, "name": "测试数据"},
}
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" : [ ]
      }
    ]
  }
}

2002 次点击
所在节点    Elasticsearch
0 条回复

这是一个专为移动设备优化的页面(即为了让你能够在 Google 搜索结果里秒开这个页面),如果你希望参与 V2EX 社区的讨论,你可以继续到 V2EX 上打开本讨论主题的完整版本。

https://www.v2ex.com/t/734214

V2EX 是创意工作者们的社区,是一个分享自己正在做的有趣事物、交流想法,可以遇见新朋友甚至新机会的地方。

V2EX is a community of developers, designers and creative people.

© 2021 V2EX