是否可以在Elasticsearch上执行Completion
并获得结果,即使文本来自输入的中间?
例如:
"TitleSuggest" : {
"type" : "completion",
"index_analyzer" : "simple",
"search_analyzer" : "simple",
"payloads" : true,
"preserve_position_increments" : false,
"preserve_separators" : false
}
那是我当前的地图和我的查询
{
"passport": {
"text": "Industry Overview",
"completion": {
"field": "TitleSuggest",
"fuzzy": {
"edit_distance": 2
}
}
}
}
但是没有返回任何内容,我的文档中包含Industry Overview
。例如,如果我只关注Industry
:
{
"text" : "Industry",
"offset" : 0,
"length" : 8,
"options" : [{
"text" : "Airline Industry Sees Recovery in 2014",
"score" : 16
}, {
"text" : "Alcoholic Drinks Industry Overview",
"score" : 16
}, {
"text" : "Challenges in the Pet Care Industry For 2014",
"score" : 16
}
]
}
我可以通过使用nGrams实现这一目标,但我希望使用completion suggesters
完成此操作因此,如果我输入Industry Overview
{
"text" : "Industry Overview",
"offset" : 0,
"length" : 8,
"options" : [{
"text" : "Alcoholic Drinks Industry Overview",
"score" : 16
}
]
}
我尝试过使用shingle分析器 - 这并没有解决问题,而且我没有在Google上找到任何有用的东西。
ES版本:1.5.1