输入弹性搜索查询时返回匹配的输入

时间:2016-06-10 12:43:44

标签: elasticsearch

以下是一个例子:

"query": {
        "bool": {
            "should": [
               {
                   "match_phrase_prefix": {
                       "keyword":{
                           "query": "pokemno", //approximative term
                           "fuzziness": 1
                       }
                   }
               },
               //... multiple should closures there
            ]
        }
    }

此查询将文档与 “神奇宝贝” 关键字匹配,但是我希望返回确切的输入搜索字词已匹配每个文档(此处, “pokemno” )。

AFAIK突出显示功能仅返回匹配的值,因为它们保存在文档中,而不是搜索输入中的值。

有没有办法从搜索中获取这些值?

0 个答案:

没有答案
相关问题