Class SemanticSearchOptions
java.lang.Object
com.azure.search.documents.models.SemanticSearchOptions
Parameters for performing vector searches.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionGet the semanticErrorHandling property: Allows the user to choose whether a semantic call should fail completely, or to return partial results.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.Get the answers property: This parameter is only valid if the query type is 'semantic'.Get the query caption property: This parameter is only valid if the query type is 'semantic'.Get the queryRewrites property: When QueryRewrites is set to `generative`, the query terms are sent to a generate model which will produce 10 (default) rewrites to help increase the recall of the request.Get the semanticConfigurationName property: The name of the semantic configuration that lists which fields should be used for semantic ranking, captions, highlights, and answers.Get the semanticQuery property: Allows setting a separate search query that will be solely used for semantic reranking, semantic captions and semantic answers.setErrorMode(SemanticErrorMode errorMode) Set the semanticErrorHandling property: Allows the user to choose whether a semantic call should fail completely, or to return partial results.setMaxWaitDuration(Duration maxWaitDuration) Set the semanticMaxWaitDuration 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.setQueryAnswer(QueryAnswer queryAnswer) Set the answers property: This parameter is only valid if the query type is 'semantic'.setQueryCaption(QueryCaption queryCaption) Set the query caption property: This parameter is only valid if the query type is 'semantic'.setQueryRewrites(QueryRewrites queryRewrites) Set the queryRewrites property: When QueryRewrites is set to `generative`, the query terms are sent to a generate model which will produce 10 (default) rewrites to help increase the recall of the request.setSemanticConfigurationName(String semanticConfigurationName) Set the semanticConfigurationName property: The name of the semantic configuration that lists which fields should be used for semantic ranking, captions, highlights, and answers.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.
-
Constructor Details
-
SemanticSearchOptions
public SemanticSearchOptions()Creates a new instance ofSemanticSearchOptions.
-
-
Method Details
-
getSemanticConfigurationName
Get the semanticConfigurationName property: The name of the semantic configuration that lists which fields should be used for semantic ranking, captions, highlights, and answers.- Returns:
- the semanticConfigurationName value.
-
setSemanticConfigurationName
Set the semanticConfigurationName property: The name of the semantic configuration that lists which fields should be used for semantic ranking, captions, highlights, and answers.- Parameters:
semanticConfigurationName- the semanticConfigurationName value to set.- Returns:
- the SemanticSearchOptions object itself.
-
getErrorMode
Get the semanticErrorHandling property: Allows the user to choose whether a semantic call should fail completely, or to return partial results.- Returns:
- the semanticErrorHandling value.
-
setErrorMode
Set the semanticErrorHandling property: Allows the user to choose whether a semantic call should fail completely, or to return partial results.- Parameters:
errorMode- the semanticErrorHandling value to set.- Returns:
- the SemanticSearchOptions object itself.
-
getMaxWaitDuration
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 semanticMaxWaitDuration value.
-
setMaxWaitDuration
Set the semanticMaxWaitDuration 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:
maxWaitDuration- the semanticMaxWaitInMilliseconds value to set.- Returns:
- the SemanticSearchOptions object itself.
-
getQueryAnswer
Get the answers property: This parameter is only valid if the query type is 'semantic'. If set, the query returns answers extracted from key passages in the highest ranked documents. The number of answers returned can be configured by appending the pipe character '|' followed by the 'count-<number of answers>' option after the answers parameter value, such as 'extractive|count-3'. Default count is 1. The confidence threshold can be configured by appending the pipe character '|' followed by the 'threshold-<confidence threshold>' option after the answers parameter value, such as 'extractive|threshold-0.9'. Default threshold is 0.7.- Returns:
- the answers value.
-
setQueryAnswer
Set the answers property: This parameter is only valid if the query type is 'semantic'. If set, the query returns answers extracted from key passages in the highest ranked documents. The number of answers returned can be configured by appending the pipe character '|' followed by the 'count-<number of answers>' option after the answers parameter value, such as 'extractive|count-3'. Default count is 1. The confidence threshold can be configured by appending the pipe character '|' followed by the 'threshold-<confidence threshold>' option after the answers parameter value, such as 'extractive|threshold-0.9'. Default threshold is 0.7.- Parameters:
queryAnswer- the answers value to set.- Returns:
- the SemanticSearchOptions object itself.
-
getQueryCaption
Get the query caption property: This parameter is only valid if the query type is 'semantic'. If set, the query returns captions extracted from key passages in the highest ranked documents. When Captions is set to 'extractive', highlighting is enabled by default, and can be configured by appending the pipe character '|' followed by the 'highlight-<true/false>' option, such as 'extractive|highlight-true'. Defaults to 'None'.- Returns:
- the query caption value.
-
setQueryCaption
Set the query caption property: This parameter is only valid if the query type is 'semantic'. If set, the query returns captions extracted from key passages in the highest ranked documents. When Captions is set to 'extractive', highlighting is enabled by default, and can be configured by appending the pipe character '|' followed by the 'highlight-<true/false>' option, such as 'extractive|highlight-true'. Defaults to 'None'.- Parameters:
queryCaption- the query caption value to set.- Returns:
- the SemanticSearchOptions object itself.
-
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.
-
setSemanticQuery
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 SemanticSearchOptions object itself.
-
getQueryRewrites
Get the queryRewrites property: When QueryRewrites is set to `generative`, the query terms are sent to a generate model which will produce 10 (default) rewrites to help increase the recall of the request. The requested count can be configured by appending the pipe character `|` followed by the `count-<number of rewrites>` option, such as `generative|count-3`. Defaults to `None`. This parameter is only valid if the query type is `semantic`.- Returns:
- the queryRewrites value.
-
setQueryRewrites
Set the queryRewrites property: When QueryRewrites is set to `generative`, the query terms are sent to a generate model which will produce 10 (default) rewrites to help increase the recall of the request. The requested count can be configured by appending the pipe character `|` followed by the `count-<number of rewrites>` option, such as `generative|count-3`. Defaults to `None`. This parameter is only valid if the query type is `semantic`.- Parameters:
queryRewrites- the queryRewrites value to set.- Returns:
- the SemanticSearchOptions object itself.
-