Autocompletion by most popular phrases in the text

Let's say I have many text fields indexed:

{
  "body": "The quick brown fox jumps over the lazy dog"
}

{
  "body": "There was a quick brown fox in a forest"
}

{
  "body": "Forest was a most fun place for a lazy dog to play."
}

{
  "body": "He wants a lazy dog to play."
}
...

I would like to implement a search phrase suggestion by the phrases in the text that are indexed. Let's say if an user types qui the suggestions show quick. If user types quick it would suggest quick brown, quick brown fox etc.

OOTB autocomplete feature seems to give me whole body field, not just phrase. search_as_you_type does the same. Term suggesters suggests just one word, phrase suggesters just tries to fix typos. Nothing that I have tried seemed to give me the result I need.

Is there a way to do this, at first glance, simple task?

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.