How to get full word Top Searches

From what I can see, “Top Searches” returns the search string only. I want to have the full word that text is part of so I can display a list of “Top Searches” to users.

Search string = “refr”
Search string is part of word “refrigerator”
When I display a list of “Top Searches” I want to show “refrigerator”, not “refr”

Can Algolia give that to me? Or do I need to build it out myself?

Hello Eric,

Excellent question!
Building an index of suggestions is indeed something we’re exploring at Algolia, but what we’re building requires quite a lot of traffic for it to make it relevant: that’s why it’s currently only for some of our Pro or Enterprise customers.

That being said, there are ways to achieve what you’re doing - but it requires a handful of search operations. Basically, you could run a search for every “Top Searches”, and look at the highlighted results for the first few results and see if it matches a full word.
In your example, if you were to run search with the query “refr”, you would see that the results would all match the word “refrigerator” (in the _highlightedResult part of the response), and thus would make you confident that “refr” is only a prefix match.

However, be careful when building suggestions on top of your Top Searches. If your users figure it out, you could be a victim of spam or cheat. See how it happened for a large French retailer last year:

Hope this is helpful.