Skip to content

Commit c42c76a

Browse files
Update opensearch flow documentation with Neural sparse search configuration details (#10167)
* Update opensearch flow documentation with Neural sparse search configuring details Signed-off-by: saimedhi <saimedhi@amazon.com> * Update _vector-search/ai-search/building-flows.md Co-authored-by: kolchfa-aws <105444904+kolchfa-aws@users.noreply.github.com> Signed-off-by: Sai Medhini Reddy Maryada <117196660+saimedhi@users.noreply.github.com> * Update _vector-search/ai-search/building-flows.md Co-authored-by: kolchfa-aws <105444904+kolchfa-aws@users.noreply.github.com> Signed-off-by: Sai Medhini Reddy Maryada <117196660+saimedhi@users.noreply.github.com> * Update _vector-search/ai-search/building-flows.md Co-authored-by: kolchfa-aws <105444904+kolchfa-aws@users.noreply.github.com> Signed-off-by: Sai Medhini Reddy Maryada <117196660+saimedhi@users.noreply.github.com> * Update _vector-search/ai-search/building-flows.md Co-authored-by: kolchfa-aws <105444904+kolchfa-aws@users.noreply.github.com> Signed-off-by: Sai Medhini Reddy Maryada <117196660+saimedhi@users.noreply.github.com> * Update _vector-search/ai-search/building-flows.md Co-authored-by: kolchfa-aws <105444904+kolchfa-aws@users.noreply.github.com> Signed-off-by: Sai Medhini Reddy Maryada <117196660+saimedhi@users.noreply.github.com> * Update _vector-search/ai-search/building-flows.md Co-authored-by: kolchfa-aws <105444904+kolchfa-aws@users.noreply.github.com> Signed-off-by: Sai Medhini Reddy Maryada <117196660+saimedhi@users.noreply.github.com> * Update _vector-search/ai-search/building-flows.md Co-authored-by: kolchfa-aws <105444904+kolchfa-aws@users.noreply.github.com> Signed-off-by: Sai Medhini Reddy Maryada <117196660+saimedhi@users.noreply.github.com> * Update _vector-search/ai-search/building-flows.md Signed-off-by: kolchfa-aws <105444904+kolchfa-aws@users.noreply.github.com> --------- Signed-off-by: saimedhi <saimedhi@amazon.com> Signed-off-by: Sai Medhini Reddy Maryada <117196660+saimedhi@users.noreply.github.com> Signed-off-by: kolchfa-aws <105444904+kolchfa-aws@users.noreply.github.com> Co-authored-by: kolchfa-aws <105444904+kolchfa-aws@users.noreply.github.com>
1 parent d8cef6f commit c42c76a

File tree

1 file changed

+49
-0
lines changed

1 file changed

+49
-0
lines changed

_vector-search/ai-search/building-flows.md

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -441,3 +441,52 @@ Override the query so that it contains a `knn` query, including the embedding ou
441441
```
442442

443443
{% include copy.html %}
444+
445+
446+
---
447+
448+
## Neural sparse search
449+
450+
This example demonstrates how to configure neural sparse search.
451+
452+
### ML resources
453+
454+
Create and deploy a [neural sparse encoding model](https://github.com/opensearch-project/dashboards-flow-framework/blob/main/documentation/models.md#neural-sparse-encoding).
455+
456+
### Index
457+
458+
Ensure that the index mappings include a `rank_features` field:
459+
460+
```
461+
"<embedding_field_name>": {
462+
"type": "rank_features"
463+
}
464+
```
465+
{% include copy.html %}
466+
467+
### Ingest pipeline
468+
469+
Configure a single ML inference processor. Map your input text to the `text_doc` model input field. Optionally, map the output `response` to a new document field. Transform the response if needed using a JSONPath expression.
470+
471+
472+
### Search pipeline
473+
474+
Configure a single ML inference search request processor. Map the query field containing the input text to the `text_doc` model input field. Optionally, map the output `response` to a new field. Transform the response if needed using a JSONPath expression. Include a neural sparse query:
475+
476+
```
477+
{
478+
"_source": {
479+
"excludes": [
480+
"<embedding_field>"
481+
]
482+
},
483+
"query": {
484+
"neural_sparse": {
485+
"<embedding_field>": {
486+
"query_tokens": ${response},
487+
}
488+
}
489+
}
490+
}
491+
```
492+
{% include copy.html %}

0 commit comments

Comments
 (0)