> ## Documentation Index
> Fetch the complete documentation index at: https://docs.commerce.blazity.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Autocomplete

> Learn how Autocomplete works under the hood

<Frame>
  <img className="block" src="https://mintcdn.com/blazity-5fe0ee45/M_ubvkjvRjPWuVoH/images/autocomplete.gif?s=e537a9c92045819cfc431839554a0b22" alt="Mega menu" width="2226" height="802" data-path="images/autocomplete.gif" />
</Frame>

Enterprise Commerce leverages Server Actions to provide a highly efficient and scalable autocomplete feature.
By utilizing search SDK entirely on the server side, we ensure optimal performance and minimize the number of queries required.

When a user searches for a product, such as a `t-shirt` the autocomplete functionality is triggered.
Instead of sending a query to the search engine for each user request, Enterprise Commerce employs aggressive caching mechanisms. This means that if 10 million users visit your page and search for `t-shirt`, only a single query is executed, rather than 10 million individual queries.

This approach offers several benefits:

1. **Reduced Query Load:** By caching search results, Enterprise Commerce significantly reduces the number of queries sent to the search engine, even with a high volume of concurrent users.

2. **Improved Performance:** Caching autocomplete results on the server side minimizes the latency experienced by users, providing near-instant suggestions as they type.

3. **Cost Efficiency:** With fewer queries being executed, the cost associated with search operations is greatly reduced, making it more cost-effective compared to traditional eCommerce autocomplete implementations.

4. **Scalability:** The combination of Server Actions and Meilisearch allows Enterprise Commerce to handle large-scale traffic without compromising performance or query efficiency.
