Skip to main content

Query Suggestions

These examples highlight the use of the autocomplete-plugin-query-suggestions plugin to show suggested search queries in your autocomplete menu. For more information, see Build a Query Suggestions UI with Autocomplete.

Search suggestions

query-suggestions

As users start typing, the autocomplete menu shows suggested search queries.

Search suggestions with categories

query-suggestions-with-categories

The top suggestions are shown with categories to help users search more precisely.

Search suggestions with inline categories

query-suggestions-with-inline-categories

Categories are shown on the same line as the suggestion for a more compact experience.

Multiple sources

These examples highlight the use of multiple data sources for the autocomplete items. The examples use multiple plugins, such as the autocomplete-plugin-query-suggestions, autocomplete-plugin-recent-searches, and the getAlgoliaResults function to retrieve search results. For more information, see Sources.

Search suggestions and results

query-suggestions-with-hits

As users start typing, the autocomplete menu shows suggested searches and matching search results.

Search suggestions and recent searches

query-suggestions-with-recent-searches

This autocomplete menu remembers previous searches and shows them on top of the suggested searches.

Search suggestions with categories and recent searches

query-suggestions-with-recent-searches-and-categories

This autocomplete menu shows the top search suggestions with their categories in addition to recent searches.

Search suggestions with recent searches and search results

reshape

In addition to recent searches and search suggestions, this autocomplete shows matching search results grouped by category.

Federated ecommerce search experience

ecom-advanced-federated-experience-desktop

This autocomplete menu features a two-column layout that shows recent searches and suggestions in the left column, and matching products in a grid in the right column.

Integrate Autocomplete

These examples show how to integrate Autocomplete with InstantSearch or popular frontend frameworks.

Autocomplete and React InstantSearch

instantsearch

Autocomplete + React InstantSearch

Autocomplete and InstantSearch.js

instantsearch

Autocomplete + InstantSearch.js

Autocomplete and Vue InstantSearch

instantsearch

Autocomplete + Vue InstantSearch

Autocomplete and React

react-renderer

Custom React renderer

Other

These examples highlight other autocomplete features and plugins.

Static sources

github-repositories

As users start typing, this autocomplete menu shows matching predefined links to GitHub repositories.

Recently-viewed items

recently-viewed-items

This autocomplete menu remembers items that users have previously viewed and shows them before the user starts typing (empty query).

Redirect searches

redirect-url

This autocomplete menu redirects users to other pages if the query matches predefined criteria.
I