AutocompleteOptions Class
- java.
lang. Object - com.
azure. search. documents. models. AutocompleteOptions
- com.
public final class AutocompleteOptions
Options for autocomplete API.
Constructor Summary
| Constructor | Description |
|---|---|
| AutocompleteOptions(String searchText, String suggesterName) |
Creates an instance of Autocomplete |
Method Summary
| Modifier and Type | Method and Description |
|---|---|
|
Autocomplete |
getAutocompleteMode()
Get the autocomplete |
| String |
getFilter()
Get the filter property: An OData expression that filters the documents used to produce completed terms for the Autocomplete result. |
| String |
getHighlightPostTag()
Get the highlight |
| String |
getHighlightPreTag()
Get the highlight |
| Double |
getMinimumCoverage()
Get the minimum |
| List<String> |
getSearchFields()
Get the search |
| String |
getSearchText()
Get the search |
| String |
getSuggesterName()
Get the suggester |
| Integer |
getTop()
Get the top property: The number of auto-completed terms to retrieve. |
| Boolean |
isUseFuzzyMatching()
Get the use |
|
Autocomplete |
setAutocompleteMode(AutocompleteMode autocompleteMode)
Set the autocomplete |
|
Autocomplete |
setFilter(String filter)
Set the filter property: An OData expression that filters the documents used to produce completed terms for the Autocomplete result. |
|
Autocomplete |
setHighlightPostTag(String highlightPostTag)
Set the highlight |
|
Autocomplete |
setHighlightPreTag(String highlightPreTag)
Set the highlight |
|
Autocomplete |
setMinimumCoverage(Double minimumCoverage)
Set the minimum |
|
Autocomplete |
setSearchFields(List<String> searchFields)
Set the search |
|
Autocomplete |
setSearchFields(String[] searchFields)
Set the search |
|
Autocomplete |
setTop(Integer top)
Set the top property: The number of auto-completed terms to retrieve. |
|
Autocomplete |
setUseFuzzyMatching(Boolean useFuzzyMatching)
Set the use |
Methods inherited from java.lang.Object
Constructor Details
AutocompleteOptions
public AutocompleteOptions(String searchText, String suggesterName)
Creates an instance of AutocompleteOptions class.
Parameters:
Method Details
getAutocompleteMode
public AutocompleteMode 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:
getFilter
public String getFilter()
Get the filter property: An OData expression that filters the documents used to produce completed terms for the Autocomplete result.
Returns:
getHighlightPostTag
public String 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:
getHighlightPreTag
public String 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:
getMinimumCoverage
public Double 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:
getSearchFields
public List<String> getSearchFields()
Get the searchFields property: The comma-separated list of field names to consider when querying for auto-completed terms. Target fields must be included in the specified suggester.
Returns:
getSearchText
public String getSearchText()
Get the searchText property: The search text on which to base autocomplete results.
Returns:
getSuggesterName
public String getSuggesterName()
Get the suggesterName property: The name of the suggester as specified in the suggesters collection that's part of the index definition.
Returns:
getTop
public Integer 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:
isUseFuzzyMatching
public Boolean isUseFuzzyMatching()
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 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.
Returns:
setAutocompleteMode
public AutocompleteOptions setAutocompleteMode(AutocompleteMode autocompleteMode)
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:
Returns:
setFilter
public AutocompleteOptions setFilter(String filter)
Set the filter property: An OData expression that filters the documents used to produce completed terms for the Autocomplete result.
Parameters:
Returns:
setHighlightPostTag
public AutocompleteOptions setHighlightPostTag(String highlightPostTag)
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:
Returns:
setHighlightPreTag
public AutocompleteOptions setHighlightPreTag(String highlightPreTag)
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:
Returns:
setMinimumCoverage
public AutocompleteOptions 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. This parameter can be useful for ensuring search availability even for services with only one replica. The default is 80.
Parameters:
Returns:
setSearchFields
public AutocompleteOptions setSearchFields(List<String> searchFields)
Set the searchFields property: The comma-separated list of field names to consider when querying for auto-completed terms. Target fields must be included in the specified suggester.
Parameters:
Returns:
setSearchFields
public AutocompleteOptions setSearchFields(String[] searchFields)
Set the searchFields property: The comma-separated list of field names to consider when querying for auto-completed terms. Target fields must be included in the specified suggester.
Parameters:
Returns:
setTop
public AutocompleteOptions setTop(Integer top)
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:
Returns:
setUseFuzzyMatching
public AutocompleteOptions setUseFuzzyMatching(Boolean useFuzzyMatching)
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 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.
Parameters:
Returns: