How to suggest (autocomplete) next word in elastic search?

elasticsearch

Solution

Elasticsearch provides a convenient way to get autocomplete up and running quickly with its completion suggester feature.

Check this link, this is what you are looking for

https://qbox.io/blog/multi-field-partial-word-autocomplete-in-elasticsearch-using-ngrams

Completion Suggester also helps you to achieve this functionality

Problem

Lets say I have following strings indexed: ``` "My awesome pizza" "My awesome beer" "Heineken is awesome beer" "I love pizza pepperoni" "Where is my beer" ``` For input `"My"` I want to suggest: - My awesome - My beer For input `"awesome"` I want to suggest: - awesome pizza - awesome beer etc. So I want to provide next words after user input... Also with some fuzziness (aEwsome) should be also supported. Which suggesters/analyzers I should use? I tried Term and completion but it is not what I want (completion for example works only when search for start of the phrase - if I pass word that is in the middle of indexed string then it will not suggest it,)

Original source