Class KnnQuery
Namespace: OpenSearch.Client
Assembly: OpenSearch.Client.dll
Syntax
[DataContract]
public class KnnQuery : FieldNameQueryBase, IKnnQuery, IFieldNameQuery, IQuery
Properties
|
Edit this page
View Source
Conditionless
Declaration
protected override bool Conditionless { get; }
Property Value
Overrides
|
Edit this page
View Source
ExpandNestedDocs
Whether to expand and search over the nested documents of each matching parent document.
Supported from OpenSearch 2.19.
Declaration
public bool? ExpandNestedDocs { get; set; }
Property Value
|
Edit this page
View Source
Filter
The result restriction filter query.
Declaration
public IQueryContainer Filter { get; set; }
Property Value
|
Edit this page
View Source
K
The number of neighbors the search of each graph will return.
Declaration
public int? K { get; set; }
Property Value
|
Edit this page
View Source
MaxDistance
The maximum physical vector space distance required in order for a neighbor to be considered a hit.
Declaration
public float? MaxDistance { get; set; }
Property Value
|
Edit this page
View Source
MethodParameters
Additional engine-specific parameters that control the approximate k-NN search at query time,
such as ef_search (HNSW) or nprobes (IVF). Supported from OpenSearch 2.16.
Declaration
public IDictionary<string, object> MethodParameters { get; set; }
Property Value
|
Edit this page
View Source
MinScore
The minimum similarity score required in order for a neighbor to be considered a hit.
Declaration
public float? MinScore { get; set; }
Property Value
|
Edit this page
View Source
Rescore
Controls the rescoring of approximate k-NN search results using full-precision vectors.
Pass a bool to enable or disable rescoring, or a KnnQueryRescoreContext
to configure it. Supported from OpenSearch 2.17.
Declaration
public Union<bool, KnnQueryRescoreContext> Rescore { get; set; }
Property Value
|
Edit this page
View Source
Vector
The vector to search for.
Declaration
public float[] Vector { get; set; }
Property Value
Implements
Extension Methods