Maxim Mironjuk
-
February 09, 2025
For a simple autocomplete on brand or category names, a full-fledged completion suggester with its own suggest index and dedicated mapping is often overkill. The terms enum API offers a considerably lighter alternative: it reads the unique values already present in a field's term index directly and returns prefix matches, without running a complete search request with scoring, relevance calculation, or document retrieval. That makes it well suited for fast suggestion lists on low-cardinality keyword fields such as brand or category names. How the terms enum API works technically, how it differs from the completion suggester, and how a practical brand autocomplete can be built on top of it is what this article covers.