SuggestPostRequest Class
SuggestPostRequest.
Constructor
SuggestPostRequest()
Variables
| Name | Description |
|---|---|
|
filter
|
An OData expression that filters the documents considered for suggestions. |
|
fuzzy
|
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. |
|
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 comma-separated 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
|
The search text to use to suggest documents. Must be at least 1 character, and no more than 100 characters. Required. |
|
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 comma-separated list of fields to retrieve. If unspecified, only the key field will be included in the results. |
|
suggesterName
|
The name of the suggester as specified in the suggesters collection that's part of the index definition. Required. |
|
top
|
The number of suggestions to retrieve. This must be a value between 1 and 100. The default is 5. |
Methods
| clear | |
| copy | |
| fromkeys |
Create a new dictionary with keys from iterable and values set to value. |
| get |
Return the value for key if key is in the dictionary, else default. |
| items | |
| keys | |
| pop |
If the key is not found, return the default if given; otherwise, raise a KeyError. |
| popitem |
Remove and return a (key, value) pair as a 2-tuple. Pairs are returned in LIFO (last-in, first-out) order. Raises KeyError if the dict is empty. |
| setdefault |
Insert key with a value of default if key is not in the dictionary. Return the value for key if key is in the dictionary, else default. |
| update |
If E is present and has a .keys() method, then does: for k in E.keys(): D[k] = E[k] If E is present and lacks a .keys() method, then does: for k, v in E: D[k] = v In either case, this is followed by: for k in F: D[k] = F[k] |
| values |
clear
clear() -> None. Remove all items from D.
copy
copy() -> a shallow copy of D
fromkeys
Create a new dictionary with keys from iterable and values set to value.
fromkeys(value=None, /)
Positional-Only Parameters
| Name | Description |
|---|---|
|
iterable
Required
|
|
|
value
|
Default value: None
|
get
Return the value for key if key is in the dictionary, else default.
get(key, default=None, /)
Positional-Only Parameters
| Name | Description |
|---|---|
|
key
Required
|
|
|
default
|
Default value: None
|
items
items() -> a set-like object providing a view on D's items
keys
keys() -> a set-like object providing a view on D's keys
pop
If the key is not found, return the default if given; otherwise, raise a KeyError.
pop(k, [d]) -> v, remove specified key and return the corresponding value.
popitem
Remove and return a (key, value) pair as a 2-tuple.
Pairs are returned in LIFO (last-in, first-out) order. Raises KeyError if the dict is empty.
popitem()
setdefault
Insert key with a value of default if key is not in the dictionary.
Return the value for key if key is in the dictionary, else default.
setdefault(key, default=None, /)
Positional-Only Parameters
| Name | Description |
|---|---|
|
key
Required
|
|
|
default
|
Default value: None
|
update
If E is present and has a .keys() method, then does: for k in E.keys(): D[k] = E[k] If E is present and lacks a .keys() method, then does: for k, v in E: D[k] = v In either case, this is followed by: for k in F: D[k] = F[k]
update([E], **F) -> None. Update D from mapping/iterable E and F.
values
values() -> an object providing a view on D's values
Attributes
filter
An OData expression that filters the documents considered for suggestions.
filter: str
fuzzy
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.
fuzzy: bool
highlightPostTag
A string tag that is appended to hit highlights. Must be set with highlightPreTag. If omitted, hit highlighting of suggestions is disabled.
highlightPostTag: str
highlightPreTag
A string tag that is prepended to hit highlights. Must be set with highlightPostTag. If omitted, hit highlighting of suggestions is disabled.
highlightPreTag: str
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: float
orderby
The comma-separated 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: list[str]
search
The search text to use to suggest documents. Must be at least 1 character, and no more than 100 characters. Required.
search: str
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: list[str]
select
The comma-separated list of fields to retrieve. If unspecified, only the key field will be included in the results.
select: list[str]
suggesterName
The name of the suggester as specified in the suggesters collection that's part of the index definition. Required.
suggesterName: str
top
The number of suggestions to retrieve. This must be a value between 1 and 100. The default is 5.
top: int