Control how many characters / keystrokes before a query runs
You can control how many characters / keystrokes a user must type before a query is run. This is useful if you want reduce the number of queries sent from your search interface, or simply to control when suggestions are returned or instant searches are run.
By default search queries will be run after third keystroke
Using the Search UI Widgets, this feature is easily controlled by setting using the minimumCharacters
key.
Input Widget
For the search input widget, you must specify minimumCharacters
in the options
object, like so:
"options": {
"minimumCharacters": 5
},
Results Widget:
For the search results widget, if you are displaying the input
in the search results, then you must specify minimumCharacters
in the input
object, like so:
"input": {
"hide": true,
"position": "top",
"minimumCharacters": 5
}
Now no queries will be run until a user makes 5 keystrokes in the search bar. Of course this can be changed to any value you like.