From cce3ab1805ce8bc899d3954a39387f5f27ac8083 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Tue, 8 Jul 2025 10:49:03 +0000 Subject: [PATCH] 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 * 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 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> (cherry picked from commit c42c76ac4f37d525b35eda69157c3972b00156d6) Signed-off-by: github-actions[bot] --- _vector-search/ai-search/building-flows.md | 49 ++++++++++++++++++++++ 1 file changed, 49 insertions(+) diff --git a/_vector-search/ai-search/building-flows.md b/_vector-search/ai-search/building-flows.md index 8a840ffd4a..245765b2e1 100644 --- a/_vector-search/ai-search/building-flows.md +++ b/_vector-search/ai-search/building-flows.md @@ -441,3 +441,52 @@ Override the query so that it contains a `knn` query, including the embedding ou ``` {% include copy.html %} + + +--- + +## Neural sparse search + +This example demonstrates how to configure neural sparse search. + +### ML resources + +Create and deploy a [neural sparse encoding model](https://github.com/opensearch-project/dashboards-flow-framework/blob/main/documentation/models.md#neural-sparse-encoding). + +### Index + +Ensure that the index mappings include a `rank_features` field: + +``` +"": { + "type": "rank_features" +} +``` +{% include copy.html %} + +### Ingest pipeline + +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. + + +### Search pipeline + +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: + +``` +{ + "_source": { + "excludes": [ + "" + ] + }, + "query": { + "neural_sparse": { + "": { + "query_tokens": ${response}, + } + } + } +} +``` +{% include copy.html %} \ No newline at end of file