Elasticsearch Completion in the middle of a sentence
Is it possible to execute Completion
on Elasticsearch and get the result even if the text is from the middle of the input?
For example:
"TitleSuggest" : {
"type" : "completion",
"index_analyzer" : "simple",
"search_analyzer" : "simple",
"payloads" : true,
"preserve_position_increments" : false,
"preserve_separators" : false
}
What is my current mapping and my request
{
"passport": {
"text": "Industry Overview",
"completion": {
"field": "TitleSuggest",
"fuzzy": {
"edit_distance": 2
}
}
}
}
But nothing is returned, I have documents containing Industry Overview
in their input. For example, if I'm only looking for 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
}
]
}
I can achieve this using nGrams, but I would like to do it using completion hints
So my original goal is achieved if I type Industry Overview
{
"text" : "Industry Overview",
"offset" : 0,
"length" : 8,
"options" : [{
"text" : "Alcoholic Drinks Industry Overview",
"score" : 16
}
]
}
I tried using the pebble parser - it didn't solve the problem and I didn't come up with anything useful.
ES version: 1.5.1
source to share
No one has answered this question yet
Check out similar questions: