Skip to content

[BUG] Profile API fails to provide execution information with Hybrid Search #1255

Open
@owaiskazi19

Description

@owaiskazi19

What is the bug?

To use profile with hybrid query, add a flag like the below

 {
  "_source": {
    "exclude": [
      "passage_embedding"
    ]
  },
  "profile": true,
  "query": {
    "hybrid": {
      "queries": [
        {
          "match": {
            "passage_text": {
              "query": "planet"
            }
          }
        },
        {
          "neural": {
            "passage_embedding": {
              "query_text": "Hi planet",
              "model_id": "BmrU-JUBz_767L5dRelX",
              "k": 5
            }
          }
        }
      ]
    }
  }
}

that fails with the below response

{
    "error": {
        "root_cause": [
            {
                "type": "illegal_argument_exception",
                "reason": "scorers are null for all sub-queries in hybrid query"
            }
        ],
        "type": "search_phase_execution_exception",
        "reason": "all shards failed",
        "phase": "query",
        "grouped": true,
        "failed_shards": [
            {
                "shard": 0,
                "index": "my-nlp-index3",
                "node": "OKVfWEhcSXmsvDBNg3IKSA",
                "reason": {
                    "type": "illegal_argument_exception",
                    "reason": "scorers are null for all sub-queries in hybrid query"
                }
            }
        ],
        "caused_by": {
            "type": "illegal_argument_exception",
            "reason": "scorers are null for all sub-queries in hybrid query",
            "caused_by": {
                "type": "illegal_argument_exception",
                "reason": "scorers are null for all sub-queries in hybrid query"
            }
        }
    },
    "status": 400
}

Logs

[2025-04-02T15:45:58,631][ERROR][o.o.n.s.c.HybridTopScoreDocCollector] [integTest-0] cannot find scorer of type HybridQueryScorer in a hierarchy of scorer org.apache.lucene.search.MultiCollector$MultiLeafCollector$1@2440ab2d

How can one reproduce the bug?

  1. Run a hybrid query and pass the profile flag
    "profile": true,

What is the expected behavior?

Hybrid query should provide timing information about the execution of individual components of a search request

What is your host/environment?

Operating system, version.

Do you have any screenshots?

If applicable, add screenshots to help explain your problem.

Do you have any additional context?

Add any other context about the problem.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions