SearchModelFactory.VectorQuery Method

Definition

The query parameters for vector and hybrid search queries. Please note this is the abstract base class. The derived classes available for instantiation are: VectorizedQuery, VectorizableTextQuery, VectorizableImageUrlQuery, and VectorizableImageBinaryQuery.

public static Azure.Search.Documents.Models.VectorQuery VectorQuery(int? kNearestNeighborsCount = default, string fieldsRaw = default, bool? exhaustive = default, double? oversampling = default, float? weight = default, Azure.Search.Documents.Models.VectorThreshold threshold = default, string filterOverride = default, int? perDocumentVectorLimit = default, string kind = default);
static member VectorQuery : Nullable<int> * string * Nullable<bool> * Nullable<double> * Nullable<single> * Azure.Search.Documents.Models.VectorThreshold * string * Nullable<int> * string -> Azure.Search.Documents.Models.VectorQuery
Public Shared Function VectorQuery (Optional kNearestNeighborsCount As Nullable(Of Integer) = Nothing, Optional fieldsRaw As String = Nothing, Optional exhaustive As Nullable(Of Boolean) = Nothing, Optional oversampling As Nullable(Of Double) = Nothing, Optional weight As Nullable(Of Single) = Nothing, Optional threshold As VectorThreshold = Nothing, Optional filterOverride As String = Nothing, Optional perDocumentVectorLimit As Nullable(Of Integer) = Nothing, Optional kind As String = Nothing) As VectorQuery

Parameters

kNearestNeighborsCount
Nullable<Int32>

Number of nearest neighbors to return as top hits.

fieldsRaw
String

Vector Fields of type Collection(Edm.Single) to be included in the vector searched.

exhaustive
Nullable<Boolean>

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.

oversampling
Nullable<Double>

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.

weight
Nullable<Single>

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.

threshold
VectorThreshold

The threshold used for vector queries. Note this can only be set if all 'fields' use the same similarity metric.

filterOverride
String

The OData filter expression to apply to this specific vector query. If no filter expression is defined at the vector level, the expression defined in the top level filter parameter is used instead.

perDocumentVectorLimit
Nullable<Int32>

Controls how many vectors can be matched from each document in a vector search query. Setting it to 1 ensures at most one vector per document is matched, guaranteeing results come from distinct documents. Setting it to 0 (unlimited) allows multiple relevant vectors from the same document to be matched. Default is 0.

kind
String

Type of query.

Returns

A new VectorQuery instance for mocking.

Applies to