# Default search pipeline support with sparse encoding indices

**URL:** <https://forum.opensearch.org/t/default-search-pipeline-support-with-sparse-encoding-indices/16373>\
**Category:** Machine Learning\
**Created:** [October 21, 2023, 9:23am UTC](https://forum.opensearch.org/t/default-search-pipeline-support-with-sparse-encoding-indices/16373 "2023-10-21T09:23:20Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![asfoorial](https://avatars.discourse-cdn.com/v4/letter/a/3da27b/32.png) [@asfoorial](https://forum.opensearch.org/u/asfoorial)\
**Post date:** [October 21, 2023, 9:23am UTC](https://forum.opensearch.org/t/default-search-pipeline-support-with-sparse-encoding-indices/16373/1 "2023-10-21T09:23:20Z")

</div>

OpenSearch 2.11.0

Hi all,

I was wondering if sparse neural search have any support for default search pipeline (neural\_query\_enricher)? I created ingestion and search pipelines as shown below and tried to search but got an error requiring me to pass a model id.

PUT /\_ingest/pipeline/nlp-ingest-pipeline-sparse  
{  
“description”: “An sparse encoding ingest pipeline”,  
“processors”: [  
{  
“sparse\_encoding”: {  
“model\_id”: “7v52UYsBsF8TdmF-f-F3”,  
“field\_map”: {  
“passage\_text”: “passage\_embedding”  
}  
}  
}  
]  
}

PUT /\_search/pipeline/default\_model\_pipeline  
{  
“request\_processors”: [  
{  
“neural\_query\_enricher” : {  
“default\_model\_id”: “7v52UYsBsF8TdmF-f-F3”  
}  
}  
]  
}

PUT /sparse\_index2  
{  
“settings”: {  
“default\_pipeline”: “nlp-ingest-pipeline-sparse”,  
“index.search.default\_pipeline” : “default\_model\_pipeline”  
},  
“mappings”: {  
“properties”: {  
“id”: {  
“type”: “text”  
},  
“passage\_embedding”: {  
“type”: “rank\_features”  
},  
“passage\_text”: {  
“type”: “text”  
}  
}  
}  
}

PUT /sparse\_index2/\_doc/1  
{  
“passage\_text”: “Arya Stark is a key character in GOT”,  
“id”: “s1”  
}

GET sparse\_index2/\_search  
{  
“\_source”: “passage\_text”,  
“query”: {  
“neural\_sparse”: {  
“passage\_embedding”: {  
“query\_text”: “who killed the night king”,  
“max\_token\_score”: 2  
}  
}  
}  
}

But I got the following error:

model\_id field must be provided for [neural\_sparse] query

---

<div class="post-metadata">

**Author:** ![ylwu](https://avatars.discourse-cdn.com/v4/letter/y/a9a28c/32.png) [@ylwu](https://forum.opensearch.org/u/ylwu)\
**Post date:** [October 26, 2023, 11:54pm UTC](https://forum.opensearch.org/t/default-search-pipeline-support-with-sparse-encoding-indices/16373/2 "2023-10-26T23:54:16Z")

</div>

@modelcollapse Charlie can you help on this?

@asfoorial one small suggestion : you can format the request body for easy reading

---

<div class="post-metadata">

**Author:** ![zane\_neo](https://avatars.discourse-cdn.com/v4/letter/z/0ea827/32.png) [@zane\_neo](https://forum.opensearch.org/u/zane_neo)\
**Post date:** [October 27, 2023, 1:12am UTC](https://forum.opensearch.org/t/default-search-pipeline-support-with-sparse-encoding-indices/16373/3 "2023-10-27T01:12:44Z")

</div>

Hi @asfoorial, in 2.11 we only released the neural search(k-NN) search pipeline support, neural encoding search pipeline will be supported in 2.12.

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex019/uploads/mauve_hedgehog/original/2X/3/33547ea01a5b12dcca2958411d3edd97ae2ea8c1.png) [@system](https://forum.opensearch.org/u/system)\
**Post date:** [December 26, 2023, 1:13am UTC](https://forum.opensearch.org/t/default-search-pipeline-support-with-sparse-encoding-indices/16373/4 "2023-12-26T01:13:32Z")

</div>

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.
