AutocompletePostRequest Class
AutocompletePostRequest.
Constructor
AutocompletePostRequest()
Variables
| Name | Description |
|---|---|
|
search
|
The search text on which to base autocomplete results. Required. |
|
autocompleteMode
|
Specifies the mode for Autocomplete. The default is 'oneTerm'. Use 'twoTerms' to get shingles and 'oneTermWithContext' to use the current context while producing auto-completed terms. Known values are: "oneTerm", "twoTerms", and "oneTermWithContext". |
|
filter
|
An OData expression that filters the documents used to produce completed terms for the Autocomplete result. |
|
fuzzy
|
A value indicating whether to use fuzzy matching for the autocomplete query. Default is false. When set to true, the query will autocomplete 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 autocomplete queries 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 is disabled. |
|
highlightPreTag
|
A string tag that is prepended to hit highlights. Must be set with highlightPostTag. If omitted, hit highlighting is disabled. |
|
minimumCoverage
|
A number between 0 and 100 indicating the percentage of the index that must be covered by an autocomplete 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. |
|
searchFields
|
The comma-separated list of field names to consider when querying for auto-completed terms. Target fields must be included in the specified suggester. |
|
suggesterName
|
The name of the suggester as specified in the suggesters collection that's part of the index definition. Required. |
|
top
|
The number of auto-completed terms 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
autocompleteMode
Specifies the mode for Autocomplete. The default is 'oneTerm'. Use 'twoTerms' to get shingles and 'oneTermWithContext' to use the current context while producing auto-completed terms. Known values are: "oneTerm", "twoTerms", and "oneTermWithContext".
autocompleteMode: str | AutocompleteMode
filter
An OData expression that filters the documents used to produce completed terms for the Autocomplete result.
filter: str
fuzzy
A value indicating whether to use fuzzy matching for the autocomplete query. Default is false. When set to true, the query will autocomplete 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 autocomplete queries 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 is disabled.
highlightPostTag: str
highlightPreTag
A string tag that is prepended to hit highlights. Must be set with highlightPostTag. If omitted, hit highlighting is disabled.
highlightPreTag: str
minimumCoverage
A number between 0 and 100 indicating the percentage of the index that must be covered by an autocomplete 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
search
The search text on which to base autocomplete results. Required.
search: Required[str]
searchFields
The comma-separated list of field names to consider when querying for auto-completed terms. Target fields must be included in the specified suggester.
searchFields: list[str]
suggesterName
The name of the suggester as specified in the suggesters collection that's part of the index definition. Required.
suggesterName: Required[str]
top
The number of auto-completed terms to retrieve. This must be a value between 1 and 100. The default is 5.
top: int