HybridSearch Class

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

Implements

public final class HybridSearch
implements JsonSerializable<HybridSearch>

The query parameters to configure hybrid search behaviors.

Constructor Summary

Constructor Description
HybridSearch()

Creates an instance of HybridSearch class.

Method Summary

Modifier and Type Method and Description
static HybridSearch fromJson(JsonReader jsonReader)

Reads an instance of HybridSearch from the JsonReader.

HybridCountAndFacetMode getCountAndFacetMode()

Get the countAndFacetMode property: Determines whether the count and facets should includes all documents that matched the search query, or only the documents that are retrieved within the 'maxTextRecallSize' window.

Integer getMaxTextRecallSize()

Get the maxTextRecallSize property: Determines the maximum number of documents to be retrieved by the text query portion of a hybrid search request.

HybridSearch setCountAndFacetMode(HybridCountAndFacetMode countAndFacetMode)

Set the countAndFacetMode property: Determines whether the count and facets should includes all documents that matched the search query, or only the documents that are retrieved within the 'maxTextRecallSize' window.

HybridSearch setMaxTextRecallSize(Integer maxTextRecallSize)

Set the maxTextRecallSize property: Determines the maximum number of documents to be retrieved by the text query portion of a hybrid search request.

JsonWriter toJson(JsonWriter jsonWriter)

Methods inherited from java.lang.Object

Constructor Details

HybridSearch

public HybridSearch()

Creates an instance of HybridSearch class.

Method Details

fromJson

public static HybridSearch fromJson(JsonReader jsonReader)

Reads an instance of HybridSearch from the JsonReader.

Parameters:

jsonReader - The JsonReader being read.

Returns:

An instance of HybridSearch 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 HybridSearch.

getCountAndFacetMode

public HybridCountAndFacetMode getCountAndFacetMode()

Get the countAndFacetMode property: Determines whether the count and facets should includes all documents that matched the search query, or only the documents that are retrieved within the 'maxTextRecallSize' window.

Returns:

the countAndFacetMode value.

getMaxTextRecallSize

public Integer getMaxTextRecallSize()

Get the maxTextRecallSize property: Determines the maximum number of documents to be retrieved by the text query portion of a hybrid search request. Those documents will be combined with the documents matching the vector queries to produce a single final list of results. Choosing a larger maxTextRecallSize value will allow retrieving and paging through more documents (using the top and skip parameters), at the cost of higher resource utilization and higher latency. The value needs to be between 1 and 10,000. Default is 1000.

Returns:

the maxTextRecallSize value.

setCountAndFacetMode

public HybridSearch setCountAndFacetMode(HybridCountAndFacetMode countAndFacetMode)

Set the countAndFacetMode property: Determines whether the count and facets should includes all documents that matched the search query, or only the documents that are retrieved within the 'maxTextRecallSize' window.

Parameters:

countAndFacetMode - the countAndFacetMode value to set.

Returns:

the HybridSearch object itself.

setMaxTextRecallSize

public HybridSearch setMaxTextRecallSize(Integer maxTextRecallSize)

Set the maxTextRecallSize property: Determines the maximum number of documents to be retrieved by the text query portion of a hybrid search request. Those documents will be combined with the documents matching the vector queries to produce a single final list of results. Choosing a larger maxTextRecallSize value will allow retrieving and paging through more documents (using the top and skip parameters), at the cost of higher resource utilization and higher latency. The value needs to be between 1 and 10,000. Default is 1000.

Parameters:

maxTextRecallSize - the maxTextRecallSize value to set.

Returns:

the HybridSearch object itself.

toJson

public JsonWriter toJson(JsonWriter jsonWriter)

Parameters:

jsonWriter

Throws:

Applies to