# Autocomplete

Autocomplete allows users to quickly complete search queries by providing suggestions as users type. Once a user starts entering their query, they can see autocomplete suggestions appear below the search box and can easily select them to complete their query.

Autocomplete is especially useful to users who are searching on mobile devices or who need extra assistance when typing such as fixing spelling.

Autocomplete suggestions also enable you to show your users popular or trending searches since query suggestions are returned in order of popularity.

In this section we will explain how autocomplete works out-of-the-box and how you can customize it.

### Querying using Autocomplete <a href="#querying-using-autocomplete" id="querying-using-autocomplete"></a>

Search.io builds a custom autocomplete model from the records in your collection and queries that users type into your search box. As a user types a query, the autocomplete model returns a list of phrases that begin with the text typed by the user. Autocomplete suggestions are returned in order of popularity, from most popular to least popular.

Autocomplete also corrects spelling so suggestions will still be returned if a user types a misspelled word.

A typical search using autocomplete consists of two modes:

1. **Autocomplete mode** - Active as a user is typing into the search box. Autocomplete suggestions are returned as the user types. This uses a [query pipeline](https://docs.search.io/developer-documentation/fundamentals/pipelines/query-pipelines) dedicated to Autocomplete which returns suggestions not search results
2. **Query mode** - Active when a user triggers a search by pressing the return key, clicking a suggestion or clicking the search button. A search is performed and results are returned. This uses the standard [query pipeline](https://docs.search.io/developer-documentation/fundamentals/pipelines/query-pipelines) dedicated to returning search results&#x20;

See the developer guide for more information on how to [configure autocomplete](https://docs.search.io/developer-documentation/guides/using-pipelines/configuring-autocomplete).


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.search.io/documentation/deep-dives/autocomplete.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
