SuggestRequest interface

Parameters for filtering, sorting, fuzzy matching, and other suggestions query behaviors.

Properties

filter

An OData expression that filters the documents considered for suggestions.

highlightPostTag

A string tag that is appended to hit highlights. Must be set with highlightPreTag. If omitted, hit highlighting of suggestions is disabled.

highlightPreTag

A string tag that is prepended to hit highlights. Must be set with highlightPostTag. If omitted, hit highlighting of suggestions is disabled.

minimumCoverage

A number between 0 and 100 indicating the percentage of the index that must be covered by a suggestion query in order for the query to be reported as a success. This parameter can be useful for ensuring search availability even for services with only one replica. The default is 80.

orderBy

The list of OData $orderby expressions by which to sort the results. Each expression can be either a field name or a call to either the geo.distance() or the search.score() functions. Each expression can be followed by asc to indicate ascending, or desc to indicate descending. The default is ascending order. Ties will be broken by the match scores of documents. If no $orderby is specified, the default sort order is descending by document match score. There can be at most 32 $orderby clauses.

searchFields

The comma-separated list of field names to search for the specified search text. Target fields must be included in the specified suggester.

select

The list of fields to retrieve. If unspecified, only the key field will be included in the results.

top

/**

  • The number of suggestions to retrieve. This must be a value between 1 and 100. The default is
useFuzzyMatching

A value indicating whether to use fuzzy matching for the suggestion query. Default is false. When set to true, the query will find suggestions even if there's a substituted or missing character in the search text. While this provides a better experience in some scenarios, it comes at a performance cost as fuzzy suggestion searches are slower and consume more resources.

Property Details

filter

An OData expression that filters the documents considered for suggestions.

filter?: string

Property Value

string

highlightPostTag

A string tag that is appended to hit highlights. Must be set with highlightPreTag. If omitted, hit highlighting of suggestions is disabled.

highlightPostTag?: string

Property Value

string

highlightPreTag

A string tag that is prepended to hit highlights. Must be set with highlightPostTag. If omitted, hit highlighting of suggestions is disabled.

highlightPreTag?: string

Property Value

string

minimumCoverage

A number between 0 and 100 indicating the percentage of the index that must be covered by a suggestion query in order for the query to be reported as a success. This parameter can be useful for ensuring search availability even for services with only one replica. The default is 80.

minimumCoverage?: number

Property Value

number

orderBy

The list of OData $orderby expressions by which to sort the results. Each expression can be either a field name or a call to either the geo.distance() or the search.score() functions. Each expression can be followed by asc to indicate ascending, or desc to indicate descending. The default is ascending order. Ties will be broken by the match scores of documents. If no $orderby is specified, the default sort order is descending by document match score. There can be at most 32 $orderby clauses.

orderBy?: string[]

Property Value

string[]

searchFields

The comma-separated list of field names to search for the specified search text. Target fields must be included in the specified suggester.

searchFields?: SearchFieldArray<TModel>

Property Value

select

The list of fields to retrieve. If unspecified, only the key field will be included in the results.

select?: SelectArray<TFields>

Property Value

SelectArray<TFields>

top

/**

  • The number of suggestions to retrieve. This must be a value between 1 and 100. The default is
top?: number

Property Value

number

useFuzzyMatching

A value indicating whether to use fuzzy matching for the suggestion query. Default is false. When set to true, the query will find suggestions even if there's a substituted or missing character in the search text. While this provides a better experience in some scenarios, it comes at a performance cost as fuzzy suggestion searches are slower and consume more resources.

useFuzzyMatching?: boolean

Property Value

boolean