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
48 changes: 48 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,51 @@ Override the query so that it contains a `knn` query, including the embedding ou
```

{% include copy.html %}


---

## 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 the index mappings include `rank_features` field, as follows:

```
"<embedding_field_name>": {
"type": "rank_features"
}
```

{% include copy.html %}

### Ingest pipeline

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 JSONPath expression.


### Search pipeline

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 JSONPath expression. Override the query to a neural sparse query. For example:

```
{
"_source": {
"excludes": [
"<embedding_field>"
]
},
"query": {
"neural_sparse": {
"<embedding_field>": {
"query_tokens": ${response},
}
}
}
}
```

{% include copy.html %}