Error in Default Search Pipeline with Reranking

Hi all,

I am trying OS 2.12.0 and got the following error

{
“error”: {
“root_cause”: [
{
“type”: “null_pointer_exception”,
“reason”: “Cannot invoke "org.opensearch.neuralsearch.query.ext.RerankSearchExtBuilder.getParams()" because the return value of "org.opensearch.neuralsearch.query.ext.RerankSearchExtBuilder.fromExtBuilderList(java.util.List)" is null”
}
],
“type”: “null_pointer_exception”,
“reason”: “Cannot invoke "org.opensearch.neuralsearch.query.ext.RerankSearchExtBuilder.getParams()" because the return value of "org.opensearch.neuralsearch.query.ext.RerankSearchExtBuilder.fromExtBuilderList(java.util.List)" is null”
},
“status”: 500
}

In simple words, I am creating a search pipeline that has both default model and rerank. This pipeline was added to an index as a default search pipeline. Everything works fine if I include rerank clause. If I remove it then I get the error. The expected behavior is that my query should work weather it is a simple text search, match, query_string, neural or any other query. rerank should not be a required clause if the index has a default search pipeline.

Below are the details.

  1. Created a default search pipeline

PUT /_search/pipeline/default_model_pipeline
{
“request_processors”: [
{
“neural_query_enricher”: {
“default_model_id”: “RGEA7o0BQ3TcLCs4bYFY”
}
}
],
“response_processors”: [
{
“rerank”: {
“ml_opensearch”: {
“model_id”: “5jj07Y0BCK-cIDRT8Ara”
},
“context”: {
“document_fields”: [
“text”
]
}
}
}
]
}
}

  1. Create a KNN Index

{
“test_index”: {
“aliases”: {},
“mappings”: {
“_routing”: {
“required”: true
},
“properties”: {
“text”: {
“type”: “text”
},
“embedding”: {
“type”: “knn_vector”,
“dimension”: 768,
“method”: {
“engine”: “nmslib”,
“space_type”: “cosinesimil”,
“name”: “hnsw”,
“parameters”: {
“ef_construction”: 512,
“m”: 16
}
}
}
}
},
“settings”: {
“index”: {
“replication”: {
“type”: “DOCUMENT”
},
“mapping”: {
“total_fields”: {
“limit”: “1000”
}
},
“refresh_interval”: “60s”,
“knn”: “true”,
“number_of_replicas”: “2”,
“codec”: “best_compression”,
“search”: {
“default_pipeline”: “default_model_pipeline”
},
“number_of_shards”: “4”
}
}
}
}

  1. Executed the following query and got an error.

GET test_index/_search
{
“_source”: {
“includes”: [
“text”
]
},
“query”: {
“neural”: {
“embedding”: {
“query_text”: “hello”,
“k”: 100
}
}
},
“ext”: {
“rerank”: {
“query_context”: {
“query_text”: “hello”
}
}
}
}

Greetings!
I get exactly the same error with a regular request

{
“query”: {
“match_all”: {}
}

The same error occurs when getting the number of documents in the index:
POST my-index/_count