What is the bug?
When the neural query is nested, the neural_field_default_id from the neural_query_enricher isn't set for request's model_id. This leads to the error: "type": "null_pointer_exception", "reason": "modelId is marked non-null but is null" if we don't explicitly pass the model_id.
How can one reproduce the bug?
- create a search pipeline with a
neural_query_enricher
- perform a
function_score query with the search pipeline, where the neural query (without explicitly passing the model_id) is nested inside it.
What is the expected behavior?
model_id is inferred from neural_query_enricher in the search pipeline
What is your host/environment?
Do you have any screenshots?
Our search pipeline:
{
"default_model_pipeline": {
"request_processors": [
{
"neural_query_enricher": {
"neural_field_default_id": {
"searchTextEmbedding": "aQJlv5QBnZfSLyF3MObN"
}
}
}
]
}
}
Below works:
POST routing-events-2025-04-11/_search?search_pipeline=default_model_pipeline
{
"query": {
"neural": {
"searchTextEmbedding": {
"query_text": "test",
"k": 150
}
}
}
}
Below fails with the error "modelId is marked non-null but is null"
POST routing-events-2025-04-11/_search?search_pipeline=default_model_pipeline
{
"query": {
"function_score": {
"query": {
"neural": {
"searchTextEmbedding": {
"query_text": "test",
"k": 150
}
}
},
"functions": [
{
"gauss": {
"eventHeader.timestamp": {
"origin": "now",
"scale": "30d",
"offset": "10d",
"decay": 0.5
}
}
}
],
"boost_mode": "multiply"
}
}
}
Do you have any additional context?
Add any other context about the problem.
What is the bug?
When the
neuralquery is nested, theneural_field_default_idfrom theneural_query_enricherisn't set for request'smodel_id. This leads to the error: "type": "null_pointer_exception", "reason": "modelId is marked non-null but is null" if we don't explicitly pass themodel_id.How can one reproduce the bug?
neural_query_enricherfunction_scorequery with the search pipeline, where theneuralquery (without explicitly passing themodel_id) is nested inside it.What is the expected behavior?
model_idis inferred fromneural_query_enricherin the search pipelineWhat is your host/environment?
Do you have any screenshots?
Our search pipeline:
Below works:
Below fails with the error "modelId is marked non-null but is null"
Do you have any additional context?
Add any other context about the problem.