Skip to content

[BUG] Neural query modelId is not nullable when used in nested query #15034

Closed as not planned
@marcus-bcl

Description

@marcus-bcl

Describe the bug

Using the neural_query_enricher processor in a search pipeline allows you to set the default model_id for a neural query.

However, when trying to use a nested query containing a neural query (e.g. for chunked text embeddings), it still requires you to provide the model_id.

Related component

Search

To Reproduce

  1. Create an indexed with a nested knn field.
  2. Add a search pipeline with a default_model_id, as per https://opensearch.org/docs/latest/search-plugins/semantic-search/#setting-a-default-model-on-an-index-or-field
  3. Perform a nested query e.g.
GET /my-index/_search
{
  "query": {
    "nested": {
      "score_mode": "max",
      "path": "text_embedding",
      "query": {
        "neural": {
          "text_embedding.knn": {
            "query_text": "my query text"
          }
        }
      }
    }
  }
}
  1. 500 Error is returned:
[HTTP/1.1 500 Internal Server Error]
{"error":{"root_cause":[{"type":"null_pointer_exception","reason":"modelId is marked non-null but is null"}],"type":"null_pointer_exception","reason":"modelId is marked non-null but is null"},"status":500}

Expected behavior

Expect a 200 response with search results

Additional Details

Plugins
ml

Host/Environment (please complete the following information):

  • Amazon OpenSearch 2.13

Metadata

Metadata

Assignees

No one assigned

    Labels

    SearchSearch query, autocomplete ...etcbugSomething isn't working

    Type

    No type

    Projects

    Status

    ✅ Done

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions