SearchOptions Class

  • java.lang.Object
    • com.azure.search.documents.models.SearchOptions

public final class SearchOptions

Options for search API.

Constructor Summary

Constructor Description
SearchOptions()

Creates an instance of SearchOptions class.

Method Summary

Modifier and Type Method and Description
QueryAnswerType getAnswers()

Get the answers property: A value that specifies whether answers should be returned as part of the search response.

QueryCaptionType getCaptions()

Get the captions property: A value that specifies whether captions should be returned as part of the search response.

QueryDebugMode getDebug()

Get the debug property: Enables a debugging tool that can be used to further explore your reranked results.

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 highlightFields property: The comma-separated list of field names to use for hit highlights.

String getHighlightPostTag()

Get the highlightPostTag property: A string tag that is appended to hit highlights.

String getHighlightPreTag()

Get the highlightPreTag property: A string tag that is prepended to hit highlights.

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.

List<String> getOrderBy()

Get the orderBy property: The comma-separated list of OData $orderby expressions by which to sort the results.

QueryType getQueryType()

Get the queryType property: A value that specifies the syntax of the search query.

List<String> getScoringParameters()

Get the scoringParameters property: The list of parameter values to be used in scoring functions (for example, referencePointParameter) using the format name-values.

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.

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.

List<String> getSearchFields()

Get the searchFields property: The comma-separated list of field names to which to scope the full-text search.

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.

String getSearchText()

Get the searchText property: A full-text search query expression; Use "*" or omit this parameter to match all documents.

List<String> getSelect()

Get the select property: The comma-separated list of fields to retrieve.

String getSemanticConfigurationName()

Get the semanticConfigurationName property: The name of a semantic configuration that will be used when processing documents for queries of type semantic.

SemanticErrorMode getSemanticErrorHandling()

Get the semanticErrorHandling property: Allows the user to choose whether a semantic call should fail completely (default / current behavior), or to return partial results.

Integer getSemanticMaxWaitInMilliseconds()

Get the semanticMaxWaitInMilliseconds property: Allows the user to set an upper bound on the amount of time it takes for semantic enrichment to finish processing before the request fails.

String getSemanticQuery()

Get the semanticQuery property: Allows setting a separate search query that will be solely used for semantic reranking, semantic captions and semantic answers.

String getSessionId()

Get the sessionId property: A value to be used to create a sticky session, which can help getting more consistent results.

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.

VectorFilterMode getVectorFilterMode()

Get the vectorFilterMode property: Determines whether or not filters are applied before or after the vector search is performed.

List<VectorQuery> getVectorQueries()

Get the vectorQueries property: The query parameters for vector and hybrid search queries.

Boolean isIncludeTotalCount()

Get the includeTotalCount property: A value that specifies whether to fetch the total count of results.

SearchOptions setAnswers(QueryAnswerType answers)

Set the answers property: A value that specifies whether answers should be returned as part of the search response.

SearchOptions setCaptions(QueryCaptionType captions)

Set the captions property: A value that specifies whether captions should be returned as part of the search response.

SearchOptions setDebug(QueryDebugMode debug)

Set the debug property: Enables a debugging tool that can be used to further explore your reranked results.

SearchOptions setFacets(List<String> facets)

Set the facets property: The list of facet expressions to apply to the search query.

SearchOptions setFacets(String[] facets)

Set the facets property: The list of facet expressions to apply to the search query.

SearchOptions setFilter(String filter)

Set the filter property: The OData $filter expression to apply to the search query.

SearchOptions setHighlightFields(List<String> highlightFields)

Set the highlightFields property: The comma-separated list of field names to use for hit highlights.

SearchOptions setHighlightFields(String[] highlightFields)

Set the highlightFields property: The comma-separated list of field names to use for hit highlights.

SearchOptions setHighlightPostTag(String highlightPostTag)

Set the highlightPostTag property: A string tag that is appended to hit highlights.

SearchOptions setHighlightPreTag(String highlightPreTag)

Set the highlightPreTag property: A string tag that is prepended to hit highlights.

SearchOptions setIncludeTotalCount(Boolean includeTotalCount)

Set the includeTotalCount property: A value that specifies whether to fetch the total count of results.

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.

SearchOptions setOrderBy(List<String> orderBy)

Set the orderBy property: The comma-separated list of OData $orderby expressions by which to sort the results.

SearchOptions setOrderBy(String[] orderBy)

Set the orderBy property: The comma-separated list of OData $orderby expressions by which to sort the results.

SearchOptions setQueryType(QueryType queryType)

Set the queryType property: A value that specifies the syntax of the search query.

SearchOptions setScoringParameters(List<String> scoringParameters)

Set the scoringParameters property: The list of parameter values to be used in scoring functions (for example, referencePointParameter) using the format name-values.

SearchOptions setScoringParameters(String[] scoringParameters)

Set the scoringParameters property: The list of parameter values to be used in scoring functions (for example, referencePointParameter) using the format name-values.

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.

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.

SearchOptions setSearchFields(List<String> searchFields)

Set the searchFields property: The comma-separated list of field names to which to scope the full-text search.

SearchOptions setSearchFields(String[] searchFields)

Set the searchFields property: The comma-separated list of field names to which to scope the full-text search.

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.

SearchOptions setSearchText(String searchText)

Set the searchText property: A full-text search query expression; Use "*" or omit this parameter to match all documents.

SearchOptions setSelect(List<String> select)

Set the select property: The comma-separated list of fields to retrieve.

SearchOptions setSelect(String[] select)

Set the select property: The comma-separated list of fields to retrieve.

SearchOptions setSemanticConfigurationName(String semanticConfigurationName)

Set the semanticConfigurationName property: The name of a semantic configuration that will be used when processing documents for queries of type semantic.

SearchOptions setSemanticErrorHandling(SemanticErrorMode semanticErrorHandling)

Set the semanticErrorHandling property: Allows the user to choose whether a semantic call should fail completely (default / current behavior), or to return partial results.

SearchOptions setSemanticMaxWaitInMilliseconds(Integer semanticMaxWaitInMilliseconds)

Set the semanticMaxWaitInMilliseconds property: Allows the user to set an upper bound on the amount of time it takes for semantic enrichment to finish processing before the request fails.

SearchOptions setSemanticQuery(String semanticQuery)

Set the semanticQuery property: Allows setting a separate search query that will be solely used for semantic reranking, semantic captions and semantic answers.

SearchOptions setSessionId(String sessionId)

Set the sessionId property: A value to be used to create a sticky session, which can help getting more consistent results.

SearchOptions setSkip(Integer skip)

Set the skip property: The number of search results to skip.

SearchOptions setTop(Integer top)

Set the top property: The number of search results to retrieve.

SearchOptions setVectorFilterMode(VectorFilterMode vectorFilterMode)

Set the vectorFilterMode property: Determines whether or not filters are applied before or after the vector search is performed.

SearchOptions setVectorQueries(List<VectorQuery> vectorQueries)

Set the vectorQueries property: The query parameters for vector and hybrid search queries.

SearchOptions setVectorQueries(VectorQuery[] vectorQueries)

Set the vectorQueries property: The query parameters for vector and hybrid search queries.

Methods inherited from java.lang.Object

Constructor Details

SearchOptions

public SearchOptions()

Creates an instance of SearchOptions class.

Method Details

getAnswers

public QueryAnswerType getAnswers()

Get the answers property: A value that specifies whether answers should be returned as part of the search response.

Returns:

the answers value.

getCaptions

public QueryCaptionType getCaptions()

Get the captions property: A value that specifies whether captions should be returned as part of the search response.

Returns:

the captions value.

getDebug

public QueryDebugMode getDebug()

Get the debug property: Enables a debugging tool that can be used to further explore your reranked results.

Returns:

the debug value.

getFacets

public List<String> getFacets()

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:

the facets value.

getFilter

public String getFilter()

Get the filter property: The OData $filter expression to apply to the search query.

Returns:

the filter value.

getHighlightFields

public List<String> getHighlightFields()

Get the highlightFields property: The comma-separated list of field names to use for hit highlights. Only searchable fields can be used for hit highlighting.

Returns:

the highlightFields value.

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:

the highlightPostTag value.

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:

the highlightPreTag value.

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:

the minimumCoverage value.

getOrderBy

public List<String> getOrderBy()

Get the orderBy property: 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.

Returns:

the orderBy value.

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:

the queryType value.

getScoringParameters

public List<String> getScoringParameters()

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:

the scoringParameters value.

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:

the scoringProfile value.

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. The default is 'local'. Use 'global' to aggregate scoring statistics globally before scoring. Using global scoring statistics can increase latency of search queries.

Returns:

the scoringStatistics value.

getSearchFields

public List<String> getSearchFields()

Get the searchFields property: The comma-separated 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:

the searchFields value.

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:

the searchMode value.

getSearchText

public String getSearchText()

Get the searchText property: A full-text search query expression; Use "*" or omit this parameter to match all documents.

Returns:

the searchText value.

getSelect

public List<String> getSelect()

Get the select property: The comma-separated list of fields to retrieve. If unspecified, all fields marked as retrievable in the schema are included.

Returns:

the select value.

getSemanticConfigurationName

public String getSemanticConfigurationName()

Get the semanticConfigurationName property: The name of a semantic configuration that will be used when processing documents for queries of type semantic.

Returns:

the semanticConfigurationName value.

getSemanticErrorHandling

public SemanticErrorMode getSemanticErrorHandling()

Get the semanticErrorHandling property: Allows the user to choose whether a semantic call should fail completely (default / current behavior), or to return partial results.

Returns:

the semanticErrorHandling value.

getSemanticMaxWaitInMilliseconds

public Integer getSemanticMaxWaitInMilliseconds()

Get the semanticMaxWaitInMilliseconds property: Allows the user to set an upper bound on the amount of time it takes for semantic enrichment to finish processing before the request fails.

Returns:

the semanticMaxWaitInMilliseconds value.

getSemanticQuery

public String getSemanticQuery()

Get the semanticQuery property: Allows setting a separate search query that will be solely used for semantic reranking, semantic captions and semantic answers. Is useful for scenarios where there is a need to use different queries between the base retrieval and ranking phase, and the L2 semantic phase.

Returns:

the semanticQuery value.

getSessionId

public String getSessionId()

Get the sessionId property: A value to be used to create a sticky session, which can help getting 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:

the sessionId value.

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:

the skip value.

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:

the top value.

getVectorFilterMode

public VectorFilterMode getVectorFilterMode()

Get the vectorFilterMode property: Determines whether or not filters are applied before or after the vector search is performed. Default is 'preFilter' for new indexes.

Returns:

the vectorFilterMode value.

getVectorQueries

public List<VectorQuery> getVectorQueries()

Get the vectorQueries property: The query parameters for vector and hybrid search queries.

Returns:

the vectorQueries value.

isIncludeTotalCount

public Boolean isIncludeTotalCount()

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:

the includeTotalCount value.

setAnswers

public SearchOptions setAnswers(QueryAnswerType answers)

Set the answers property: A value that specifies whether answers should be returned as part of the search response.

Parameters:

answers - the answers value to set.

Returns:

the SearchOptions object itself.

setCaptions

public SearchOptions setCaptions(QueryCaptionType captions)

Set the captions property: A value that specifies whether captions should be returned as part of the search response.

Parameters:

captions - the captions value to set.

Returns:

the SearchOptions object itself.

setDebug

public SearchOptions setDebug(QueryDebugMode debug)

Set the debug property: Enables a debugging tool that can be used to further explore your reranked results.

Parameters:

debug - the debug value to set.

Returns:

the SearchOptions object itself.

setFacets

public SearchOptions setFacets(List<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:

facets - the facets value to set.

Returns:

the SearchOptions object itself.

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:

facets - the facets value to set.

Returns:

the SearchOptions object itself.

setFilter

public SearchOptions setFilter(String filter)

Set the filter property: The OData $filter expression to apply to the search query.

Parameters:

filter - the filter value to set.

Returns:

the SearchOptions object itself.

setHighlightFields

public SearchOptions setHighlightFields(List<String> highlightFields)

Set the highlightFields property: The comma-separated list of field names to use for hit highlights. Only searchable fields can be used for hit highlighting.

Parameters:

highlightFields - the highlightFields value to set.

Returns:

the SearchOptions object itself.

setHighlightFields

public SearchOptions setHighlightFields(String[] highlightFields)

Set the highlightFields property: The comma-separated list of field names to use for hit highlights. Only searchable fields can be used for hit highlighting.

Parameters:

highlightFields - the highlightFields value to set.

Returns:

the SearchOptions object itself.

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:

highlightPostTag - the highlightPostTag value to set.

Returns:

the SearchOptions object itself.

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:

highlightPreTag - the highlightPreTag value to set.

Returns:

the SearchOptions object itself.

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:

includeTotalCount - the includeTotalCount value to set.

Returns:

the SearchOptions object itself.

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:

minimumCoverage - the minimumCoverage value to set.

Returns:

the SearchOptions object itself.

setOrderBy

public SearchOptions setOrderBy(List<String> orderBy)

Set the orderBy property: 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.

Parameters:

orderBy - the orderBy value to set.

Returns:

the SearchOptions object itself.

setOrderBy

public SearchOptions setOrderBy(String[] orderBy)

Set the orderBy property: 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.

Parameters:

orderBy - the orderBy value to set.

Returns:

the SearchOptions object itself.

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:

queryType - the queryType value to set.

Returns:

the SearchOptions object itself.

setScoringParameters

public SearchOptions setScoringParameters(List<String> 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:

scoringParameters - the scoringParameters value to set.

Returns:

the SearchOptions object itself.

setScoringParameters

public SearchOptions setScoringParameters(String[] 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:

scoringParameters - the scoringParameters value to set.

Returns:

the SearchOptions object itself.

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:

scoringProfile - the scoringProfile value to set.

Returns:

the SearchOptions object itself.

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. The default is 'local'. Use 'global' to aggregate scoring statistics globally before scoring. Using global scoring statistics can increase latency of search queries.

Parameters:

scoringStatistics - the scoringStatistics value to set.

Returns:

the SearchOptions object itself.

setSearchFields

public SearchOptions setSearchFields(List<String> searchFields)

Set the searchFields property: The comma-separated 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:

searchFields - the searchFields value to set.

Returns:

the SearchOptions object itself.

setSearchFields

public SearchOptions setSearchFields(String[] searchFields)

Set the searchFields property: The comma-separated 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:

searchFields - the searchFields value to set.

Returns:

the SearchOptions object itself.

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:

searchMode - the searchMode value to set.

Returns:

the SearchOptions object itself.

setSearchText

public SearchOptions setSearchText(String searchText)

Set the searchText property: A full-text search query expression; Use "*" or omit this parameter to match all documents.

Parameters:

searchText - the searchText value to set.

Returns:

the SearchOptions object itself.

setSelect

public SearchOptions setSelect(List<String> select)

Set the select property: The comma-separated list of fields to retrieve. If unspecified, all fields marked as retrievable in the schema are included.

Parameters:

select - the select value to set.

Returns:

the SearchOptions object itself.

setSelect

public SearchOptions setSelect(String[] select)

Set the select property: The comma-separated list of fields to retrieve. If unspecified, all fields marked as retrievable in the schema are included.

Parameters:

select - the select value to set.

Returns:

the SearchOptions object itself.

setSemanticConfigurationName

public SearchOptions setSemanticConfigurationName(String semanticConfigurationName)

Set the semanticConfigurationName property: The name of a semantic configuration that will be used when processing documents for queries of type semantic.

Parameters:

semanticConfigurationName - the semanticConfigurationName value to set.

Returns:

the SearchOptions object itself.

setSemanticErrorHandling

public SearchOptions setSemanticErrorHandling(SemanticErrorMode semanticErrorHandling)

Set the semanticErrorHandling property: Allows the user to choose whether a semantic call should fail completely (default / current behavior), or to return partial results.

Parameters:

semanticErrorHandling - the semanticErrorHandling value to set.

Returns:

the SearchOptions object itself.

setSemanticMaxWaitInMilliseconds

public SearchOptions setSemanticMaxWaitInMilliseconds(Integer semanticMaxWaitInMilliseconds)

Set the semanticMaxWaitInMilliseconds property: Allows the user to set an upper bound on the amount of time it takes for semantic enrichment to finish processing before the request fails.

Parameters:

semanticMaxWaitInMilliseconds - the semanticMaxWaitInMilliseconds value to set.

Returns:

the SearchOptions object itself.

setSemanticQuery

public SearchOptions setSemanticQuery(String semanticQuery)

Set the semanticQuery property: Allows setting a separate search query that will be solely used for semantic reranking, semantic captions and semantic answers. Is useful for scenarios where there is a need to use different queries between the base retrieval and ranking phase, and the L2 semantic phase.

Parameters:

semanticQuery - the semanticQuery value to set.

Returns:

the SearchOptions object itself.

setSessionId

public SearchOptions setSessionId(String sessionId)

Set the sessionId property: A value to be used to create a sticky session, which can help getting 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:

sessionId - the sessionId value to set.

Returns:

the SearchOptions object itself.

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:

skip - the skip value to set.

Returns:

the SearchOptions object itself.

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:

top - the top value to set.

Returns:

the SearchOptions object itself.

setVectorFilterMode

public SearchOptions setVectorFilterMode(VectorFilterMode vectorFilterMode)

Set the vectorFilterMode property: Determines whether or not filters are applied before or after the vector search is performed. Default is 'preFilter' for new indexes.

Parameters:

vectorFilterMode - the vectorFilterMode value to set.

Returns:

the SearchOptions object itself.

setVectorQueries

public SearchOptions setVectorQueries(List<VectorQuery> vectorQueries)

Set the vectorQueries property: The query parameters for vector and hybrid search queries.

Parameters:

vectorQueries - the vectorQueries value to set.

Returns:

the SearchOptions object itself.

setVectorQueries

public SearchOptions setVectorQueries(VectorQuery[] vectorQueries)

Set the vectorQueries property: The query parameters for vector and hybrid search queries.

Parameters:

vectorQueries - the vectorQueries value to set.

Returns:

the SearchOptions object itself.

Applies to