Skip to content

Conversation

mridula-s109
Copy link
Contributor

@mridula-s109 mridula-s109 commented Aug 11, 2025

PR Description:

Summary

Integrates per-field weight support into the simplified RRF retriever syntax, allowing users to specify field boosting using the field^weight notation.

Changes Made

  • Enhanced RRF Retriever Builder: Modified RRFRetrieverBuilder to parse and apply per-field weights from the simplified field syntax
  • Weight Validation: Added validation to ensure weights are non-negative (zero is allowed)
  • Feature Flag: Introduced SIMPLIFIED_WEIGHTED_SUPPORT node feature for backward compatibility
  • Comprehensive Testing: Added parsing tests, validation tests, and functional tests for various weight scenarios

Usage Example

Users can now specify weighted fields in the simplified RRF syntax:

GET /restaurants/_search
{
  "retriever": {
    "rrf": {
      "query": "pizza",
      "fields": ["name^2.0", "description^0.5", "tags"]
    }
  }
}

@mridula-s109 mridula-s109 marked this pull request as draft August 11, 2025 18:21
@mridula-s109 mridula-s109 self-assigned this Aug 21, 2025
@mridula-s109 mridula-s109 added >enhancement :SearchOrg/Relevance Label for the Search (solution/org) Relevance team Team:Search - Relevance The Search organization Search Relevance team labels Aug 21, 2025
@mridula-s109 mridula-s109 removed request for a team September 17, 2025 11:30
Copy link
Contributor

🔍 Preview links for changed docs

More links …

Copy link
Contributor

ℹ️ Important: Docs version tagging

👋 Thanks for updating the docs! Just a friendly reminder that our docs are now cumulative. This means all 9.x versions are documented on the same page and published off of the main branch, instead of creating separate pages for each minor version.

We use applies_to tags to mark version-specific features and changes.

Expand for a quick overview

When to use applies_to tags:

✅ At the page level to indicate which products/deployments the content applies to (mandatory)
✅ When features change state (e.g. preview, ga) in a specific version
✅ When availability differs across deployments and environments

What NOT to do:

❌ Don't remove or replace information that applies to an older version
❌ Don't add new information that applies to a specific version without an applies_to tag
❌ Don't forget that applies_to tags can be used at the page, section, and inline level

🤔 Need help?

@mridula-s109 mridula-s109 removed request for a team September 17, 2025 11:30
@mridula-s109 mridula-s109 force-pushed the SEARCH-1111-integrate-weights-into-simplified-rrf-retriever-syntax branch from 9f72e10 to ab376ce Compare September 17, 2025 11:33
@mridula-s109
Copy link
Contributor Author

Thanks for the feedback @ioanatia @Mikep86 @dimitris-athanasiou 🙌 I’ve made the changes and addressed all comments. Let me know if there’s anything further you’d like me to tweak.

Copy link
Contributor

@dimitris-athanasiou dimitris-athanasiou left a comment

Choose a reason for hiding this comment

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

LGTM

@mridula-s109 mridula-s109 enabled auto-merge (squash) September 18, 2025 10:00
@mridula-s109 mridula-s109 merged commit 2397543 into elastic:main Sep 18, 2025
34 checks passed
gmjehovich pushed a commit to gmjehovich/elasticsearch that referenced this pull request Sep 18, 2025
* Made changes to include simplified weights to PR:

* Add basic changes to include the feature

* implemented changes

* [CI] Auto commit changes from spotless

* Work in progress

* WIP

* WIP

* Modified changes to include the simplified rrf

* Clean the mess

* Fixed the failing tests

* Removed the it
nit*

* refactored component

* Fixed issues

* Improved the parsing tests

* Modified code

* Refactored code'

* Update and rename 133400.yaml to 132680.yaml

* cleaned up code

* Merge conflicts

* Update LinearRetrieverBuilderTests.java

* RRFBuilder checkstyle issue

* fix failing test

* [CI] Auto commit changes from spotless

* Resolved merge conflict

* [CI] Auto commit changes from spotless

* Parsing and yaml changes

* Cleaned uo the builder

* cleanedup

* Unnecessary comments

* cleaned up

* Cleanup

* Cleanup

* removed duplicate

---------

Co-authored-by: elasticsearchmachine <infra-root+elasticsearchmachine@elastic.co>
szybia added a commit to szybia/elasticsearch that referenced this pull request Sep 18, 2025
* upstream/main: (43 commits)
  Unmute testAckedIndexing to see if it still fails on main (elastic#134682)
  Silence time zone ID deprecation warning for JDK 25 due to log4j2 bug. (elastic#134719)
  Adding a getUnmodifiableSourceAndMetadata() method to IngestDocument (elastic#134816)
  Mark the create-index-from-source action as publicly available on Serverless (elastic#134953)
  ESQL: Rename command from INLINESTATS to INLINE STATS (elastic#134827)
  Document multi index query support for simplified retrievers (elastic#134980)
  [ML] Fix YAMl test to use correct query parameter type (elastic#134999)
  [Transform] Wait for PIT to close (elastic#134955)
  Add XPath to XmlUtils (elastic#134923)
  Fixing conditional processor mutability bugs (elastic#134936)
  [Transform] Lower loglevel of 3 transform-related error messages from ERROR to WARN (elastic#134985)
  Unmute pattern text tests. (elastic#134981)
  Integrate weights into simplified RRF retriever syntax (elastic#132680)
  Mute org.elasticsearch.xpack.esql.qa.mixed.MixedClusterEsqlSpecIT test {csv-spec:stats.CountDistinctWithConditions} elastic#134993
  Update periodic java-ea build to test java 26 pre-release (elastic#134983)
  Mute org.elasticsearch.xpack.esql.ccq.MultiClusterSpecIT test {csv-spec:stats.CountDistinctWithConditions} elastic#134984
  Fix and unmute testIndexSettingProviderPrivateSetting (elastic#134861)
  Add missing common cat params (elastic#134870)
  Support querying multiple indices with the simplified RRF retriever (elastic#134822)
  Allow including semantic field embeddings in _source (elastic#134717)
  ...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

>enhancement :SearchOrg/Relevance Label for the Search (solution/org) Relevance team Team:Search - Relevance The Search organization Search Relevance team v9.2.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants