Update neural search documentation to include filters (#6254)
* Update neural search documentation to include filters Signed-off-by: John Mazanec <jmazane@amazon.com> * Fix typo Signed-off-by: John Mazanec <jmazane@amazon.com> * Update _query-dsl/specialized/neural.md Co-authored-by: kolchfa-aws <105444904+kolchfa-aws@users.noreply.github.com> Signed-off-by: John Mazanec <jmazane@amazon.com> --------- Signed-off-by: John Mazanec <jmazane@amazon.com> Co-authored-by: kolchfa-aws <105444904+kolchfa-aws@users.noreply.github.com>
This commit is contained in:
parent
d41ccb8cd4
commit
d897bb8b5e
|
@ -33,6 +33,7 @@ Field | Data type | Required/Optional | Description
|
||||||
`query_image` | String | Optional | A base-64 encoded string that corresponds to the query image from which to generate vector embeddings. You must specify at least one `query_text` or `query_image`.
|
`query_image` | String | Optional | A base-64 encoded string that corresponds to the query image from which to generate vector embeddings. You must specify at least one `query_text` or `query_image`.
|
||||||
`model_id` | String | Required if the default model ID is not set. For more information, see [Setting a default model on an index or field]({{site.url}}{{site.baseurl}}/search-plugins/neural-text-search/#setting-a-default-model-on-an-index-or-field). | The ID of the model that will be used to generate vector embeddings from the query text. The model must be deployed in OpenSearch before it can be used in neural search. For more information, see [Using custom models within OpenSearch]({{site.url}}{{site.baseurl}}/ml-commons-plugin/using-ml-models/) and [Neural search]({{site.url}}{{site.baseurl}}/search-plugins/neural-search/).
|
`model_id` | String | Required if the default model ID is not set. For more information, see [Setting a default model on an index or field]({{site.url}}{{site.baseurl}}/search-plugins/neural-text-search/#setting-a-default-model-on-an-index-or-field). | The ID of the model that will be used to generate vector embeddings from the query text. The model must be deployed in OpenSearch before it can be used in neural search. For more information, see [Using custom models within OpenSearch]({{site.url}}{{site.baseurl}}/ml-commons-plugin/using-ml-models/) and [Neural search]({{site.url}}{{site.baseurl}}/search-plugins/neural-search/).
|
||||||
`k` | Integer | Optional | The number of results returned by the k-NN search. Default is 10.
|
`k` | Integer | Optional | The number of results returned by the k-NN search. Default is 10.
|
||||||
|
`filter` | Object | Optional | A query that can be used to reduce the number of documents considered. For more information about filter usage, see [k-NN search with filters]({{site.url}}{{site.baseurl}}/search-plugins/knn/filter-search-knn/). **Important**: Filter can only be used with the `faiss` or `lucene` engines.
|
||||||
|
|
||||||
#### Example request
|
#### Example request
|
||||||
|
|
||||||
|
@ -44,7 +45,26 @@ GET /my-nlp-index/_search
|
||||||
"passage_embedding": {
|
"passage_embedding": {
|
||||||
"query_text": "Hi world",
|
"query_text": "Hi world",
|
||||||
"query_image": "iVBORw0KGgoAAAAN...",
|
"query_image": "iVBORw0KGgoAAAAN...",
|
||||||
"k": 100
|
"k": 100,
|
||||||
|
"filter": {
|
||||||
|
"bool": {
|
||||||
|
"must": [
|
||||||
|
{
|
||||||
|
"range": {
|
||||||
|
"rating": {
|
||||||
|
"gte": 8,
|
||||||
|
"lte": 10
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"term": {
|
||||||
|
"parking": "true"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue