Class AutocompleteOptions
java.lang.Object
com.azure.search.documents.models.AutocompleteOptions
- All Implemented Interfaces:
com.azure.json.JsonSerializable<AutocompleteOptions>
public final class AutocompleteOptions
extends Object
implements com.azure.json.JsonSerializable<AutocompleteOptions>
Parameter group.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic AutocompleteOptionsfromJson(com.azure.json.JsonReader jsonReader) Reads an instance of AutocompleteOptions from the JsonReader.Get the autocompleteMode property: Specifies the mode for Autocomplete.Get the filter property: An OData expression that filters the documents used to produce completed terms for the Autocomplete result.Get the highlightPostTag property: A string tag that is appended to hit highlights.Get the highlightPreTag property: A string tag that is prepended to hit highlights.Get the minimumCoverage property: 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.Get the searchFields property: The list of field names to consider when querying for auto-completed terms.getTop()Get the top property: The number of auto-completed terms to retrieve.setAutocompleteMode(AutocompleteMode autocompleteMode) Set the autocompleteMode property: Specifies the mode for Autocomplete.Set the filter property: An OData expression that filters the documents used to produce completed terms for the Autocomplete result.setHighlightPostTag(String highlightPostTag) Set the highlightPostTag property: A string tag that is appended to hit highlights.setHighlightPreTag(String highlightPreTag) Set the highlightPreTag property: A string tag that is prepended to hit highlights.setMinimumCoverage(Double minimumCoverage) Set the minimumCoverage property: 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.setSearchFields(String... searchFields) Set the searchFields property: The list of field names to consider when querying for auto-completed terms.setSearchFields(List<String> searchFields) Set the searchFields property: The list of field names to consider when querying for auto-completed terms.Set the top property: The number of auto-completed terms to retrieve.setUseFuzzyMatching(Boolean useFuzzyMatching) Set the useFuzzyMatching property: A value indicating whether to use fuzzy matching for the autocomplete query.com.azure.json.JsonWritertoJson(com.azure.json.JsonWriter jsonWriter) Get the useFuzzyMatching property: A value indicating whether to use fuzzy matching for the autocomplete query.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface com.azure.json.JsonSerializable
toJson, toJson, toJsonBytes, toJsonString
-
Constructor Details
-
AutocompleteOptions
public AutocompleteOptions()Creates an instance of AutocompleteOptions class.
-
-
Method Details
-
getAutocompleteMode
Get the autocompleteMode property: 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.- Returns:
- the autocompleteMode value.
-
setAutocompleteMode
Set the autocompleteMode property: 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.- Parameters:
autocompleteMode- the autocompleteMode value to set.- Returns:
- the AutocompleteOptions object itself.
-
getFilter
Get the filter property: An OData expression that filters the documents used to produce completed terms for the Autocomplete result.- Returns:
- the filter value.
-
setFilter
Set the filter property: An OData expression that filters the documents used to produce completed terms for the Autocomplete result.- Parameters:
filter- the filter value to set.- Returns:
- the AutocompleteOptions object itself.
-
useFuzzyMatching
Get the useFuzzyMatching property: A value indicating whether to use fuzzy matching for the autocomplete 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 autocomplete queries are slower and consume more resources.- Returns:
- the useFuzzyMatching value.
-
setUseFuzzyMatching
Set the useFuzzyMatching property: A value indicating whether to use fuzzy matching for the autocomplete 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 autocomplete queries are slower and consume more resources.- Parameters:
useFuzzyMatching- the useFuzzyMatching value to set.- Returns:
- the AutocompleteOptions object itself.
-
getHighlightPostTag
Get the highlightPostTag property: A string tag that is appended to hit highlights. Must be set with highlightPreTag. If omitted, hit highlighting is disabled.- Returns:
- the highlightPostTag value.
-
setHighlightPostTag
Set the highlightPostTag property: A string tag that is appended to hit highlights. Must be set with highlightPreTag. If omitted, hit highlighting is disabled.- Parameters:
highlightPostTag- the highlightPostTag value to set.- Returns:
- the AutocompleteOptions object itself.
-
getHighlightPreTag
Get the highlightPreTag property: A string tag that is prepended to hit highlights. Must be set with highlightPostTag. If omitted, hit highlighting is disabled.- Returns:
- the highlightPreTag value.
-
setHighlightPreTag
Set the highlightPreTag property: A string tag that is prepended to hit highlights. Must be set with highlightPostTag. If omitted, hit highlighting is disabled.- Parameters:
highlightPreTag- the highlightPreTag value to set.- Returns:
- the AutocompleteOptions object itself.
-
getMinimumCoverage
Get the minimumCoverage property: 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.- Returns:
- the minimumCoverage value.
-
setMinimumCoverage
Set the minimumCoverage property: 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.- Parameters:
minimumCoverage- the minimumCoverage value to set.- Returns:
- the AutocompleteOptions object itself.
-
getSearchFields
Get the searchFields property: The list of field names to consider when querying for auto-completed terms. Target fields must be included in the specified suggester.- Returns:
- the searchFields value.
-
setSearchFields
Set the searchFields property: The list of field names to consider when querying for auto-completed terms. Target fields must be included in the specified suggester.- Parameters:
searchFields- the searchFields value to set.- Returns:
- the AutocompleteOptions object itself.
-
getTop
Get the top property: The number of auto-completed terms to retrieve. This must be a value between 1 and 100. The default is 5.- Returns:
- the top value.
-
setTop
Set the top property: The number of auto-completed terms to retrieve. This must be a value between 1 and 100. The default is 5.- Parameters:
top- the top value to set.- Returns:
- the AutocompleteOptions object itself.
-
setSearchFields
Set the searchFields property: The list of field names to consider when querying for auto-completed terms. Target fields must be included in the specified suggester.- Parameters:
searchFields- the searchFields value to set.- Returns:
- the AutocompleteOptions object itself.
-
toJson
- Specified by:
toJsonin interfacecom.azure.json.JsonSerializable<AutocompleteOptions>- Throws:
IOException
-
fromJson
Reads an instance of AutocompleteOptions from the JsonReader.- Parameters:
jsonReader- The JsonReader being read.- Returns:
- An instance of AutocompleteOptions if the JsonReader was pointing to an instance of it, or null if it was pointing to JSON null.
- Throws:
IOException- If an error occurs while reading the AutocompleteOptions.
-