Skip to content

Conversation

mridula-s109
Copy link
Contributor

@mridula-s109 mridula-s109 commented Jun 19, 2025

Summary

Adds a top-level normalizer option to the linear retriever.
The top-level normalizer acts as the default for all sub-retrievers, but each sub-retriever can override it if needed.

Behavior

Normalizer resolution priority:

  1. Retriever-specific normalizer (if specified)
  2. Top-level normalizer (if specified)
  3. None (default)

Example

GET /products/_search
{
  "retriever": {
    "linear": {
      "normalizer": "minmax",
      "retrievers": [
        {
          "retriever": {
            "standard": {
              "query": {
                "term": {"category": "electronics"}
              }
            }
          },
          "weight": 2.0
        },
        {
          "retriever": {
            "standard": {
              "query": {
                "range": {"rating": {"gte": 4.5}}
              }
            }
          },
          "weight": 1.0,
          "normalizer": "l2_norm"
        }
      ]
    }
  },
  "_source": ["name", "category", "rating", "price"]
}

@mridula-s109 mridula-s109 self-assigned this Jun 19, 2025
@elasticsearchmachine elasticsearchmachine added needs:triage Requires assignment of a team area label v9.1.0 labels Jun 19, 2025
@mridula-s109 mridula-s109 changed the title Search 1027 linear retriever top level option for normalizer Linear retriever top level option for normalizer Jun 19, 2025
@mridula-s109 mridula-s109 requested review from a team as code owners June 25, 2025 08:17
@mridula-s109 mridula-s109 force-pushed the SEARCH-1027-linear-retriever-top-level-option-for-normalizer branch from 6750bc8 to 4df0e99 Compare June 25, 2025 10:28
@mridula-s109 mridula-s109 reopened this Jun 25, 2025
@mridula-s109 mridula-s109 added >enhancement :Search/Search Search-related issues that do not fall into other categories Team:Search Meta label for search team auto-backport Automatically create backport pull requests when merged v8.19.0 labels Jun 25, 2025
@elasticsearchmachine elasticsearchmachine removed the needs:triage Requires assignment of a team area label label Jun 25, 2025
@elasticsearchmachine
Copy link
Collaborator

Pinging @elastic/es-search (Team:Search)

@elasticsearchmachine
Copy link
Collaborator

Hi @mridula-s109, I've created a changelog YAML for you.

Copy link
Contributor

github-actions bot commented Jun 26, 2025

🔍 Preview links for changed docs:

🔔 The preview site may take up to 3 minutes to finish building. These links will become live once it completes.

Copy link
Contributor

@ioanatia ioanatia left a comment

Choose a reason for hiding this comment

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

nice work and good test coverage - left some comments, most of them minor

Copy link
Contributor

@Mikep86 Mikep86 left a comment

Choose a reason for hiding this comment

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

Partial review, covered everything except the documentation. Looks good overall! I left a few minor comments.

@mridula-s109
Copy link
Contributor Author

@ioanatia @Mikep86 Appreciate the feedback! I’ve made the changes and marked them as resolved. Let me know if you spot anything else. @kderusso tagging you as well since your requested changes still need approval.

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.

Nice work @mridula-s109 - I left a few minor comments, but this is very close!

@mridula-s109
Copy link
Contributor Author

Nice work @mridula-s109 - I left a few minor comments, but this is very close!

Thanks for your comments @kderusso , have resolved all the cluster features comments and updated the documentation.

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.

Thanks for making the changes @mridula-s109 - I've left some nitpicky comments, and you may need to update/there are some failing CI tests that look unrelated. Otherwise LGTM. Nice work, thanks for iterating!

@mridula-s109
Copy link
Contributor Author

@Mikep86 Can you please have a look at it as you had requested changes as well?

Copy link
Contributor

@Mikep86 Mikep86 left a comment

Choose a reason for hiding this comment

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

Great job cleaning this up! I left a couple non-nit comments about the some missing applies_to tags in the docs. The rest is non-blocking.

@Mikep86 Mikep86 dismissed their stale review August 20, 2025 19:23

Breaking changes removed

@mridula-s109
Copy link
Contributor Author

Great job cleaning this up! I left a couple non-nit comments about the some missing applies_to tags in the docs. The rest is non-blocking.

Thanks for the comments have resolved them all.

@mridula-s109 mridula-s109 enabled auto-merge (squash) August 21, 2025 10:11
@mridula-s109 mridula-s109 merged commit f84ec74 into elastic:main Aug 21, 2025
34 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
>enhancement :Search Relevance/Search Catch all for Search Relevance Team:Search Relevance Meta label for the Search Relevance team in Elasticsearch v9.2.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants