Eva*_*kas 6 autocomplete elasticsearch
是否有可能Completion在Elasticsearch 上执行并获得结果,即使文本来自输入的中间?
例如:
"TitleSuggest" : {
"type" : "completion",
"index_analyzer" : "simple",
"search_analyzer" : "simple",
"payloads" : true,
"preserve_position_increments" : false,
"preserve_separators" : false
}
Run Code Online (Sandbox Code Playgroud)
这是我当前的映射,我的查询是
{
"passport": {
"text": "Industry Overview",
"completion": {
"field": "TitleSuggest",
"fuzzy": {
"edit_distance": 2
}
}
}
}
Run Code Online (Sandbox Code Playgroud)
但是没有返回,我有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
}
]
}
Run Code Online (Sandbox Code Playgroud)
我可以通过使用nGrams实现这一点,但我想使用完成建议器完成此操作
所以如果我输入,我的最初目标就是获得这个 Industry Overview
{
"text" : "Industry Overview",
"offset" : 0,
"length" : 8,
"options" : [{
"text" : "Alcoholic Drinks Industry Overview",
"score" : 16
}
]
}
Run Code Online (Sandbox Code Playgroud)
我尝试过使用shingle分析器 - 这并没有解决问题,而且我没有在谷歌上找到任何有用的东西.
ES版本: 1.5.1