Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] Enable support for default model id on HybridQueryBuilder #539

Closed
vibrantvarun opened this issue Jan 12, 2024 · 1 comment
Closed
Assignees
Labels
bug Something isn't working

Comments

@vibrantvarun
Copy link
Member

vibrantvarun commented Jan 12, 2024

What is the bug?

When a neural query enricher processor is created to enable the support for default model id and the neural query clause present at inner level of hybrid search query then the processor cannot add the model id in the neural clause.

How can one reproduce the bug?

  1. Create a Neural Query Enricher
  2. Create a index and add the document
  3. Create a search pipeline for (Normalization Processor)
  4. Trigger hybrid query in the below shape
query{
     hybrid{
            queries[
                  neural {
                       // do not pass model id here as you expect that neural query enricher will add it here.
                  }
           ]  
     }
}

Sample query

{
  "from" : 0,
  "size" : 1000,
  "query": {
    "hybrid": {
      "queries": [
        {
          "match": {
            "passage": {
              "query": "how many camels are there in the world."
            }
          }
        },
        {
          "neural": {
            "content_vector": {
              "query_text": "how many camels are there in the world.",
              "k": 10,
              "filter" :
              {
                "bool" :
                {
                  "must": [
                    {
                      "term": {
                      "publisher_id": {
                        "value": "abc"
                        }
                      }
                    },
                    {
                      "term": {
                      "published": {
                        "value": true
                        }
                      }
                    }
                  ]
                }
              }
            }
          }
        }
      ]
    }
  },
  "_source": true
}




What is the expected behavior?

Neural Query Enricher processor should be able to add the model id at inner level of hybrid query clause.

Do you have any additional context?

The fix to the bug is
Override the visit method from Querybuilder interface in HybridQueryBuilder and define it to the way that it parses the inner list of query builders.

@vibrantvarun
Copy link
Member Author

PR is merged now

@github-project-automation github-project-automation bot moved this from 2.12.0 to ✅ Done in Vector Search RoadMap Jan 24, 2024
@vibrantvarun vibrantvarun moved this from ✅ Done to 2.12.0 in Vector Search RoadMap Feb 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
Archived in project
Development

No branches or pull requests

1 participant