SearchOptions Class
- java.
lang. Object - com.
azure. search. documents. models. SearchOptions
- com.
public final class SearchOptions
Additional parameters for searchGet operation.
Constructor Summary
Constructor | Description |
---|---|
SearchOptions() |
Creates an instance of SearchOptions. |
Method Summary
Modifier and Type | Method and Description |
---|---|
List<String> |
getFacets()
Get the facets property: The list of facet expressions to apply to the search query. |
String |
getFilter()
Get the filter property: The OData $filter expression to apply to the search query. |
List<String> |
getHighlightFields()
Get the highlight |
String |
getHighlightPostTag()
Get the highlight |
String |
getHighlightPreTag()
Get the highlight |
Double |
getMinimumCoverage()
Get the minimum |
List<String> |
getOrderBy()
Get the order |
Query |
getQueryType()
Get the query |
List<Scoring |
getScoringParameters()
Get the scoring |
String |
getScoringProfile()
Get the scoring |
Scoring |
getScoringStatistics()
Get the scoring |
List<String> |
getSearchFields()
Get the search |
Search |
getSearchMode()
Get the search |
List<String> |
getSelect()
Get the select property: The list of fields to retrieve. |
Semantic |
getSemanticSearchOptions()
Gets the semantic search options. |
String |
getSessionId()
Get the session |
Integer |
getSkip()
Get the skip property: The number of search results to skip. |
Integer |
getTop()
Get the top property: The number of search results to retrieve. |
Vector |
getVectorSearchOptions()
Get the vector search options for vector and hybrid search queries. |
Boolean |
isTotalCountIncluded()
Get the include |
Search |
setFacets(String[] facets)
Set the facets property: The list of facet expressions to apply to the search query. |
Search |
setFilter(String filter)
Set the filter property: The OData $filter expression to apply to the search query. |
Search |
setHighlightFields(String[] highlightFields)
Set the highlight |
Search |
setHighlightPostTag(String highlightPostTag)
Set the highlight |
Search |
setHighlightPreTag(String highlightPreTag)
Set the highlight |
Search |
setIncludeTotalCount(Boolean includeTotalCount)
Set the include |
Search |
setMinimumCoverage(Double minimumCoverage)
Set the minimum |
Search |
setOrderBy(String[] orderBy)
Set the order |
Search |
setQueryType(QueryType queryType)
Set the query |
Search |
setScoringParameters(ScoringParameter[] scoringParameters)
Set the scoring |
Search |
setScoringProfile(String scoringProfile)
Set the scoring |
Search |
setScoringStatistics(ScoringStatistics scoringStatistics)
Set the scoring |
Search |
setSearchFields(String[] searchFields)
Set the search |
Search |
setSearchMode(SearchMode searchMode)
Set the search |
Search |
setSelect(String[] select)
Set the select property: The list of fields to retrieve. |
Search |
setSemanticSearchOptions(SemanticSearchOptions semanticSearchOptions)
Sets the semantic search options. |
Search |
setSessionId(String sessionId)
Set the session |
Search |
setSkip(Integer skip)
Set the skip property: The number of search results to skip. |
Search |
setTop(Integer top)
Set the top property: The number of search results to retrieve. |
Search |
setVectorSearchOptions(VectorSearchOptions vectorSearchOptions)
Sets the vector search options for vector and hybrid search queries. |
Methods inherited from java.lang.Object
Constructor Details
SearchOptions
public SearchOptions()
Creates an instance of SearchOptions.
Method Details
getFacets
public List
Get the facets property: The list of facet expressions to apply to the search query. Each facet expression contains a field name, optionally followed by a comma-separated list of name:value pairs.
Returns:
getFilter
public String getFilter()
Get the filter property: The OData $filter expression to apply to the search query.
Returns:
getHighlightFields
public List
Get the highlightFields property: The list of field names to use for hit highlights. Only searchable fields can be used for hit highlighting.
Returns:
getHighlightPostTag
public String getHighlightPostTag()
Get the highlightPostTag property: A string tag that is appended to hit highlights. Must be set with highlightPreTag. Default is .
Returns:
getHighlightPreTag
public String getHighlightPreTag()
Get the highlightPreTag property: A string tag that is prepended to hit highlights. Must be set with highlightPostTag. Default is .
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 a search 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 100.
Returns:
getOrderBy
public List
Get the orderBy property: 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, and 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.
Returns:
getQueryType
public QueryType getQueryType()
Get the queryType property: A value that specifies the syntax of the search query. The default is 'simple'. Use 'full' if your query uses the Lucene query syntax.
Returns:
getScoringParameters
public List
Get the scoringParameters property: The list of parameter values to be used in scoring functions (for example, referencePointParameter) using the format name-values. For example, if the scoring profile defines a function with a parameter called 'mylocation' the parameter string would be "mylocation--122.2,44.8" (without the quotes).
Returns:
getScoringProfile
public String getScoringProfile()
Get the scoringProfile property: The name of a scoring profile to evaluate match scores for matching documents in order to sort the results.
Returns:
getScoringStatistics
public ScoringStatistics getScoringStatistics()
Get the scoringStatistics property: A value that specifies whether we want to calculate scoring statistics (such as document frequency) globally for more consistent scoring, or locally, for lower latency.
Returns:
getSearchFields
public List
Get the searchFields property: The list of field names to which to scope the full-text search. When using fielded search (fieldName:searchExpression) in a full Lucene query, the field names of each fielded search expression take precedence over any field names listed in this parameter.
Returns:
getSearchMode
public SearchMode getSearchMode()
Get the searchMode property: A value that specifies whether any or all of the search terms must be matched in order to count the document as a match.
Returns:
getSelect
public List
Get the select property: The list of fields to retrieve. If unspecified, all fields marked as retrievable in the schema are included.
Returns:
getSemanticSearchOptions
public SemanticSearchOptions getSemanticSearchOptions()
Gets the semantic search options.
Returns:
getSessionId
public String getSessionId()
Get the sessionId property: A value to be used to create a sticky session, which can help to get more consistent results. As long as the same sessionId is used, a best-effort attempt will be made to target the same replica set. Be wary that reusing the same sessionID values repeatedly can interfere with the load balancing of the requests across replicas and adversely affect the performance of the search service. The value used as sessionId cannot start with a '_' character.
Returns:
getSkip
public Integer getSkip()
Get the skip property: The number of search results to skip. This value cannot be greater than 100,000. If you need to scan documents in sequence, but cannot use $skip due to this limitation, consider using $orderby on a totally-ordered key and $filter with a range query instead.
Returns:
getTop
public Integer getTop()
Get the top property: The number of search results to retrieve. This can be used in conjunction with $skip to implement client-side paging of search results. If results are truncated due to server-side paging, the response will include a continuation token that can be used to issue another Search request for the next page of results.
Returns:
getVectorSearchOptions
public VectorSearchOptions getVectorSearchOptions()
Get the vector search options for vector and hybrid search queries.
Returns:
isTotalCountIncluded
public Boolean isTotalCountIncluded()
Get the includeTotalCount property: A value that specifies whether to fetch the total count of results. Default is false. Setting this value to true may have a performance impact. Note that the count returned is an approximation.
Returns:
setFacets
public SearchOptions setFacets(String[] facets)
Set the facets property: The list of facet expressions to apply to the search query. Each facet expression contains a field name, optionally followed by a comma-separated list of name:value pairs.
Parameters:
Returns:
setFilter
public SearchOptions setFilter(String filter)
Set the filter property: The OData $filter expression to apply to the search query.
Parameters:
Returns:
setHighlightFields
public SearchOptions setHighlightFields(String[] highlightFields)
Set the highlightFields property: The list of field names to use for hit highlights. Only searchable fields can be used for hit highlighting.
Parameters:
Returns:
setHighlightPostTag
public SearchOptions setHighlightPostTag(String highlightPostTag)
Set the highlightPostTag property: A string tag that is appended to hit highlights. Must be set with highlightPreTag. Default is .
Parameters:
Returns:
setHighlightPreTag
public SearchOptions setHighlightPreTag(String highlightPreTag)
Set the highlightPreTag property: A string tag that is prepended to hit highlights. Must be set with highlightPostTag. Default is .
Parameters:
Returns:
setIncludeTotalCount
public SearchOptions setIncludeTotalCount(Boolean includeTotalCount)
Set the includeTotalCount property: A value that specifies whether to fetch the total count of results. Default is false. Setting this value to true may have a performance impact. Note that the count returned is an approximation.
Parameters:
Returns:
setMinimumCoverage
public SearchOptions setMinimumCoverage(Double minimumCoverage)
Set the minimumCoverage property: A number between 0 and 100 indicating the percentage of the index that must be covered by a search 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 100.
Parameters:
Returns:
setOrderBy
public SearchOptions setOrderBy(String[] orderBy)
Set the orderBy property: 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, and 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.
Parameters:
Returns:
setQueryType
public SearchOptions setQueryType(QueryType queryType)
Set the queryType property: A value that specifies the syntax of the search query. The default is 'simple'. Use 'full' if your query uses the Lucene query syntax.
Parameters:
Returns:
setScoringParameters
public SearchOptions setScoringParameters(ScoringParameter[] scoringParameters)
Set the scoringParameters property: The list of parameter values to be used in scoring functions (for example, referencePointParameter) using the format name-values. For example, if the scoring profile defines a function with a parameter called 'mylocation' the parameter string would be "mylocation--122.2,44.8" (without the quotes).
Parameters:
Returns:
setScoringProfile
public SearchOptions setScoringProfile(String scoringProfile)
Set the scoringProfile property: The name of a scoring profile to evaluate match scores for matching documents in order to sort the results.
Parameters:
Returns:
setScoringStatistics
public SearchOptions setScoringStatistics(ScoringStatistics scoringStatistics)
Set the scoringStatistics property: A value that specifies whether we want to calculate scoring statistics (such as document frequency) globally for more consistent scoring, or locally, for lower latency.
Parameters:
Returns:
setSearchFields
public SearchOptions setSearchFields(String[] searchFields)
Set the searchFields property: The list of field names to which to scope the full-text search. When using fielded search (fieldName:searchExpression) in a full Lucene query, the field names of each fielded search expression take precedence over any field names listed in this parameter.
Parameters:
Returns:
setSearchMode
public SearchOptions setSearchMode(SearchMode searchMode)
Set the searchMode property: A value that specifies whether any or all of the search terms must be matched in order to count the document as a match.
Parameters:
Returns:
setSelect
public SearchOptions setSelect(String[] select)
Set the select property: The list of fields to retrieve. If unspecified, all fields marked as retrievable in the schema are included.
Parameters:
Returns:
setSemanticSearchOptions
public SearchOptions setSemanticSearchOptions(SemanticSearchOptions semanticSearchOptions)
Sets the semantic search options.
Parameters:
Returns:
setSessionId
public SearchOptions setSessionId(String sessionId)
Set the sessionId property: A value to be used to create a sticky session, which can help to get more consistent results. As long as the same sessionId is used, a best-effort attempt will be made to target the same replica set. Be wary that reusing the same sessionID values repeatedly can interfere with the load balancing of the requests across replicas and adversely affect the performance of the search service. The value used as sessionId cannot start with a '_' character.
Parameters:
Returns:
setSkip
public SearchOptions setSkip(Integer skip)
Set the skip property: The number of search results to skip. This value cannot be greater than 100,000. If you need to scan documents in sequence, but cannot use $skip due to this limitation, consider using $orderby on a totally-ordered key and $filter with a range query instead.
Parameters:
Returns:
setTop
public SearchOptions setTop(Integer top)
Set the top property: The number of search results to retrieve. This can be used in conjunction with $skip to implement client-side paging of search results. If results are truncated due to server-side paging, the response will include a continuation token that can be used to issue another Search request for the next page of results.
Parameters:
Returns:
setVectorSearchOptions
public SearchOptions setVectorSearchOptions(VectorSearchOptions vectorSearchOptions)
Sets the vector search options for vector and hybrid search queries.
Parameters:
Returns: