Interface IKnnQuery
An approximate k-NN query.
Inherited Members
Namespace: OpenSearch.Client
Assembly: OpenSearch.Client.dll
Syntax
public interface IKnnQuery : IFieldNameQuery, IQuery
Properties
| Edit this page View SourceExpandNestedDocs
Whether to expand and search over the nested documents of each matching parent document. Supported from OpenSearch 2.19.
Declaration
[DataMember(Name = "expand_nested_docs")]
bool? ExpandNestedDocs { get; set; }
Property Value
| Type | Description |
|---|---|
| bool? |
Filter
The result restriction filter query.
Declaration
[DataMember(Name = "filter")]
IQueryContainer Filter { get; set; }
Property Value
| Type | Description |
|---|---|
| IQueryContainer |
K
The number of neighbors the search of each graph will return.
Declaration
[DataMember(Name = "k")]
int? K { get; set; }
Property Value
| Type | Description |
|---|---|
| int? |
MaxDistance
The maximum physical vector space distance required in order for a neighbor to be considered a hit.
Declaration
[DataMember(Name = "max_distance")]
float? MaxDistance { get; set; }
Property Value
| Type | Description |
|---|---|
| float? |
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
[DataMember(Name = "method_parameters")]
IDictionary<string, object> MethodParameters { get; set; }
Property Value
| Type | Description |
|---|---|
| IDictionary<string, object> |
MinScore
The minimum similarity score required in order for a neighbor to be considered a hit.
Declaration
[DataMember(Name = "min_score")]
float? MinScore { get; set; }
Property Value
| Type | Description |
|---|---|
| float? |
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
[DataMember(Name = "rescore")]
Union<bool, KnnQueryRescoreContext> Rescore { get; set; }
Property Value
| Type | Description |
|---|---|
| Union<bool, KnnQueryRescoreContext> |
Vector
The vector to search for.
Declaration
[DataMember(Name = "vector")]
float[] Vector { get; set; }
Property Value
| Type | Description |
|---|---|
| float[] |