Skip to content

Simplified Linear & RRF Retrievers - Return error on empty fields param #129962

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

Merged
merged 8 commits into from
Jun 24, 2025

Conversation

Mikep86
Copy link
Contributor

@Mikep86 Mikep86 commented Jun 24, 2025

Updates the simplified linear & rrf retrievers to return an error when the fields param is empty:

GET movies/_search
{
  "retriever": {
    "linear": {
      "fields": [],
      "normalizer": "minmax",
      "query": "Harry Potter"
    }
  }
}

Previously, this would query all fields specified by index.query.default_field, but this creates a potential future problem with supporting combinations of query and retrievers, like this:

GET movies/_search
{
  "retriever": {
    "linear": {
      "fields": [],
      "normalizer": "minmax",
      "query": "Harry Potter",
      "retrievers": [
        {
          "retriever": {
            <your custom sub-retriever here>
          }
        }
      ]
    }
  }
}

In contrast, this should (at most) only execute the custom sub-retrievers and not query any fields for "Harry Potter". Returning an error for now when the fields param is empty gives us more options for how to combine query and retrievers in the future.

@Mikep86 Mikep86 requested review from jimczi, ioanatia and kderusso June 24, 2025 19:07
@Mikep86 Mikep86 added >bug auto-backport Automatically create backport pull requests when merged :SearchOrg/Relevance Label for the Search (solution/org) Relevance team v8.19.0 v9.1.0 labels Jun 24, 2025
@elasticsearchmachine elasticsearchmachine added Team:SearchOrg Meta label for the Search Org (Enterprise Search) Team:Search - Relevance The Search organization Search Relevance team labels Jun 24, 2025
@elasticsearchmachine
Copy link
Collaborator

Pinging @elastic/search-eng (Team:SearchOrg)

@elasticsearchmachine
Copy link
Collaborator

Pinging @elastic/search-relevance (Team:Search - Relevance)

@elasticsearchmachine
Copy link
Collaborator

Hi @Mikep86, I've created a changelog YAML for you.

Copy link
Member

@kderusso kderusso left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Copy link
Contributor

@Samiul-TheSoccerFan Samiul-TheSoccerFan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@Mikep86
Copy link
Contributor Author

Mikep86 commented Jun 24, 2025

@elasticmachine update branch

@Mikep86
Copy link
Contributor Author

Mikep86 commented Jun 24, 2025

@elasticmachine update branch

@Mikep86 Mikep86 merged commit 651bc39 into elastic:main Jun 24, 2025
32 checks passed
@elasticsearchmachine
Copy link
Collaborator

💚 Backport successful

Status Branch Result
8.19

Mikep86 added a commit to Mikep86/elasticsearch that referenced this pull request Jun 24, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
auto-backport Automatically create backport pull requests when merged >bug :SearchOrg/Relevance Label for the Search (solution/org) Relevance team Team:Search - Relevance The Search organization Search Relevance team Team:SearchOrg Meta label for the Search Org (Enterprise Search) v8.19.0 v9.1.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants