Skip to content

Update opensearch flow documentation with Neural sparse search configuration details #10167

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 10 commits into from
Jul 8, 2025
Merged
49 changes: 49 additions & 0 deletions _vector-search/ai-search/building-flows.md
Original file line number Diff line number Diff line change
Expand Up @@ -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:

```
"<embedding_field_name>": {
"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": [
"<embedding_field>"
]
},
"query": {
"neural_sparse": {
"<embedding_field>": {
"query_tokens": ${response},
}
}
}
}
```
{% include copy.html %}
Loading