SuggestOptions Class

Parameter group.

Inheritance
SuggestOptions

Constructor

SuggestOptions(*, filter: Optional[str] = None, use_fuzzy_matching: Optional[bool] = None, highlight_post_tag: Optional[str] = None, highlight_pre_tag: Optional[str] = None, minimum_coverage: Optional[float] = None, order_by: Optional[List[str]] = None, search_fields: Optional[List[str]] = None, select: Optional[List[str]] = None, top: Optional[int] = None, **kwargs)

Parameters

filter
str
Required

An OData expression that filters the documents considered for suggestions.

use_fuzzy_matching
bool
Required

A value indicating whether to use fuzzy matching for the suggestions query. Default is false. When set to true, the query will find terms 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 suggestions queries are slower and consume more resources.

highlight_post_tag
str
Required

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

highlight_pre_tag
str
Required

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

minimum_coverage
float
Required

A number between 0 and 100 indicating the percentage of the index that must be covered by a suggestions 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.

order_by
list[str]
Required

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.

search_fields
list[str]
Required

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

select
list[str]
Required

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

top
int
Required

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