#192·sonic

Popularity scoring of suggest terms?

Author: abstractvectorCreated Dec 9, 2019Updated Aug 5, 2026
Labelsquestionfeat:search

First, thank you for creating this library - I, too, was disappointed in the lack of a lightweight alternative to Elasticsearch. Our use case is a search feature for our website - we're talking hundreds of blog posts, not PB of data!

I've searched but have been unable to find if it's possible to sort the SUGGEST results by popularity (i.e. the number of objects containing that term). It seems all the search terms are alphabetical.

Is such a capability existing, or if not, is it planned? I did take a look at the source code and didn't see an obvious way to incorporate it, but I have no knowledge of Rust so may be missing something obvious.

My proposed workaround in the absence of such a feature is to run the SUGGEST and then a QUERY on each of the suggested terms, counting the results for each. Given the small data sets and the speed of Sonic, I think this is viable for our use case, but open to other ideas too!