You are viewing docs on Elastic's new documentation system, currently in technical preview. For all other Elastic docs, visit elastic.co/guide.

Using search-as-you-type

Usually, the search query is executed when the user presses the enter key or clicks the search button.

Search-as-you-type feature allows search queries to be executed on every keystroke.

To implement this in Search UI, you'll need to add a searchAsYouType={true} prop to <SearchBox/> component.

It's a good idea to add a debounce time — the Search UI will wait for users to finish typing before issuing the request. You can do it by adding a debounceLength={300} prop to <SearchBox/> component.

See the example implementation below.

Related documentation:

On this page