How Sajari works
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
Sajari 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:
- Autocomplete mode - Active as a user is typing into the search box. Autocomplete suggestions are returned as the user types.
- 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.
Each mode of operation uses a different query pipeline.
An autocomplete query pipeline is used to generate autocomplete suggestions and is not used to return search results. When a user selects a generated autocomplete suggestion this is then passed a query to a standard query pipeline to generate search results.
See the developer guide for more information on how to configure autocomplete.