小编vin*_*t17的帖子

elasticsearch完成建议器产生重复结果

我正在使用弹性搜索完成建议,并且遇到了一些问题,它总是产生类似的结果.

假设我使用以下语句进行搜索:

    "my_suggestion": {
>         "text": "ni",
>         "completion": {
>             "field": "my_name_for_sug"
>         }
>     }
Run Code Online (Sandbox Code Playgroud)

并获得以下结果:

 "my_suggestion" : [ {
    "text" : "ni",
    "offset" : 0,
    "length" : 2,
    "options" : [ {
      "text" : "Nine West",
      "score" : 329.0
    }, {
      "text" : "Nine West ",
      "score" : 329.0
    }, {
      "text" : "Nike",
      "score" : 295.0
    }, {
      "text" : "NINE WEST",
      "score" : 168.0
    }, {
      "text" : "NINE WEST ",
      "score" : 168.0
    } …
Run Code Online (Sandbox Code Playgroud)

autocomplete elasticsearch search-suggestion

6
推荐指数
1
解决办法
362
查看次数