The search Index
Query string to be expanded into suggestions
Search options. The supported options and default values
are the same as for the search
method, except that by default prefix
search is performed on the last term in the query, and terms are combined
with 'AND'
.
A sorted array of suggestions sorted by relevance score.
Provide suggestions for the given search query
The result is a list of suggested modified search queries, derived from the given search query, each with a relevance score, sorted by descending score.
By default, it uses the same options used for search, except that by default it performs prefix search on the last term of the query, and combine terms with
'AND'
(requiring all query terms to match). Custom options can be passed as a second argument. Defaults can be changed by passing anautoSuggestOptions
option when initializing the index.Basic usage:
Multiple words:
Fuzzy suggestions:
Filtering: