Interface INeuralQuery
A neural query.
Inherited Members
Namespace: OpenSearch.Client
Assembly: OpenSearch.Client.dll
Syntax
public interface INeuralQuery : IFieldNameQuery, IQuery
Properties
| Edit this page View SourceExpandNestedDocs
When true, retrieves scores for all nested field documents within each parent document.
Used with nested queries.
Declaration
[DataMember(Name = "expand_nested_docs")]
bool? ExpandNestedDocs { get; set; }
Property Value
| Type | Description |
|---|---|
| bool? |
Filter
A query used to reduce the number of documents considered.
Declaration
[DataMember(Name = "filter")]
IQueryContainer Filter { get; set; }
Property Value
| Type | Description |
|---|---|
| IQueryContainer |
K
The number of results the k-NN search returns. Only one of K, MaxDistance,
or MinScore can be specified; if none is set, the server default is k = 10.
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 (radial search). Only one of K, MaxDistance, or MinScore can be specified.
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).
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 (radial search). Only one of K, MaxDistance, or MinScore can be specified.
Declaration
[DataMember(Name = "min_score")]
float? MinScore { get; set; }
Property Value
| Type | Description |
|---|---|
| float? |
ModelId
The ID of the model that will be used in the embedding interface. The model must be indexed in OpenSearch before it can be used in Neural Search.
Declaration
[DataMember(Name = "model_id")]
string ModelId { get; set; }
Property Value
| Type | Description |
|---|---|
| string |
QueryImage
A Base64-encoded string that corresponds to the query image from which to generate vector embeddings. You must specify at least one of QueryText or QueryImage.
Declaration
[DataMember(Name = "query_image")]
string QueryImage { get; set; }
Property Value
| Type | Description |
|---|---|
| string |
QueryText
The query text from which to produce queries. You must specify at least one of QueryText or QueryImage.
Declaration
[DataMember(Name = "query_text")]
string QueryText { get; set; }
Property Value
| Type | Description |
|---|---|
| string |
QueryTokens
A raw sparse vector, expressed as tokens and their weights. Used as an alternative to QueryText for direct vector input.
Declaration
[DataMember(Name = "query_tokens")]
IDictionary<string, float> QueryTokens { get; set; }
Property Value
| Type | Description |
|---|---|
| IDictionary<string, 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.
Declaration
[DataMember(Name = "rescore")]
Union<bool, KnnQueryRescoreContext> Rescore { get; set; }
Property Value
| Type | Description |
|---|---|
| Union<bool, KnnQueryRescoreContext> |
SemanticFieldSearchAnalyzer
An analyzer for tokenizing QueryText when using a sparse encoding model. Cannot be used together with ModelId.
Declaration
[DataMember(Name = "semantic_field_search_analyzer")]
string SemanticFieldSearchAnalyzer { get; set; }
Property Value
| Type | Description |
|---|---|
| string |