Complete suggestions highlighting

Hello community ! I'm seeking assistance on implementing highlighting within suggestion results in Elasticsearch. Currently, I'm utilizing the completion suggester field to generate suggestions.

Context:

When utilizing the completion suggester in Elasticsearch, it doesn't directly support highlighting similar to regular search queries.

[Best Guess]

To implement highlighting in suggestion results from the Elasticsearch completion suggester, you need a workaround because the suggester itself doesn't support highlighting. First, query the suggester to get suggestions, then use those suggestions to perform a regular search query with highlighting enabled on a text field containing the same data. Finally, combine the suggestion and highlighting results for the final output.

1 Like