Class VectorizedQuery
java.lang.Object
com.azure.search.documents.models.VectorQuery
com.azure.search.documents.models.VectorizedQuery
- All Implemented Interfaces:
com.azure.json.JsonSerializable<VectorQuery>
The query parameters to use for vector search when a raw vector value is provided.
-
Constructor Summary
ConstructorsConstructorDescriptionVectorizedQuery(List<Float> vector) Creates an instance of VectorizedQuery class. -
Method Summary
Modifier and TypeMethodDescriptionstatic VectorizedQueryfromJson(com.azure.json.JsonReader jsonReader) Reads an instance of VectorizedQuery from the JsonReader.getKind()Get the kind property: The kind of vector query being performed.Get the vector property: The vector representation of a search query.setExhaustive(Boolean exhaustive) Set the exhaustive property: When true, triggers an exhaustive k-nearest neighbor search across all vectors within the vector index.Set the fields property: Vector Fields of type Collection(Edm.Single) to be included in the vector searched.setKNearestNeighborsCount(Integer kNearestNeighborsCount) Set the kNearestNeighborsCount property: Number of nearest neighbors to return as top hits.setOversampling(Double oversampling) Set the oversampling property: Oversampling factor.Set the weight property: Relative weight of the vector query when compared to other vector query and/or the text query within the same search request.com.azure.json.JsonWritertoJson(com.azure.json.JsonWriter jsonWriter) Methods inherited from class VectorQuery
getFields, getKNearestNeighborsCount, getOversampling, getWeight, isExhaustiveMethods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface com.azure.json.JsonSerializable
toJson, toJson, toJsonBytes, toJsonString
-
Constructor Details
-
VectorizedQuery
-
-
Method Details
-
getKind
Get the kind property: The kind of vector query being performed.- Overrides:
getKindin classVectorQuery- Returns:
- the kind value.
-
getVector
-
setKNearestNeighborsCount
Set the kNearestNeighborsCount property: Number of nearest neighbors to return as top hits.- Overrides:
setKNearestNeighborsCountin classVectorQuery- Parameters:
kNearestNeighborsCount- the kNearestNeighborsCount value to set.- Returns:
- the VectorQuery object itself.
-
setFields
Set the fields property: Vector Fields of type Collection(Edm.Single) to be included in the vector searched.- Overrides:
setFieldsin classVectorQuery- Parameters:
fields- the fields value to set.- Returns:
- the VectorQuery object itself.
-
setExhaustive
Set the exhaustive property: When true, triggers an exhaustive k-nearest neighbor search across all vectors within the vector index. Useful for scenarios where exact matches are critical, such as determining ground truth values.- Overrides:
setExhaustivein classVectorQuery- Parameters:
exhaustive- the exhaustive value to set.- Returns:
- the VectorQuery object itself.
-
setOversampling
Set the oversampling property: Oversampling factor. Minimum value is 1. It overrides the 'defaultOversampling' parameter configured in the index definition. It can be set only when 'rerankWithOriginalVectors' is true. This parameter is only permitted when a compression method is used on the underlying vector field.- Overrides:
setOversamplingin classVectorQuery- Parameters:
oversampling- the oversampling value to set.- Returns:
- the VectorQuery object itself.
-
setWeight
Set the weight property: Relative weight of the vector query when compared to other vector query and/or the text query within the same search request. This value is used when combining the results of multiple ranking lists produced by the different vector queries and/or the results retrieved through the text query. The higher the weight, the higher the documents that matched that query will be in the final ranking. Default is 1.0 and the value needs to be a positive number larger than zero.- Overrides:
setWeightin classVectorQuery- Parameters:
weight- the weight value to set.- Returns:
- the VectorQuery object itself.
-
toJson
- Specified by:
toJsonin interfacecom.azure.json.JsonSerializable<VectorQuery>- Overrides:
toJsonin classVectorQuery- Throws:
IOException
-
fromJson
Reads an instance of VectorizedQuery from the JsonReader.- Parameters:
jsonReader- The JsonReader being read.- Returns:
- An instance of VectorizedQuery if the JsonReader was pointing to an instance of it, or null if it was pointing to JSON null.
- Throws:
IllegalStateException- If the deserialized JSON object was missing any required properties.IOException- If an error occurs while reading the VectorizedQuery.
-