- Notifications
You must be signed in to change notification settings - Fork 25.6k
Docs: Add weight parameter documentation for Weighted RRF retriever #136698
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
base: main
Are you sure you want to change the base?
Docs: Add weight parameter documentation for Weighted RRF retriever #136698
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR adds documentation for the weight
parameter in the Weighted RRF retriever, which was previously introduced but lacked proper documentation. The changes provide comprehensive examples and parameter descriptions to help users understand how to adjust retriever influence in RRF ranking.
- Added detailed documentation for
retriever
andweight
sub-parameters in the RRF retriever - Added weighted hybrid search example showing different weight configurations
- Updated the main RRF example to demonstrate weighted retrievers with semantic vs lexical search weighting
Reviewed Changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
File | Description |
---|---|
docs/reference/elasticsearch/rest-apis/retrievers/rrf-retriever.md | Added weight parameter documentation, sub-parameters section, and weighted hybrid search example |
docs/reference/elasticsearch/rest-apis/retrievers/retrievers-examples.md | Updated main RRF example to use weighted format with semantic search having higher influence |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
docs/reference/elasticsearch/rest-apis/retrievers/retrievers-examples.md Outdated Show resolved Hide resolved
Pinging @elastic/search-relevance (Team:Search - Relevance) |
Pinging @elastic/core-docs (Team:Docs) |
ℹ️ 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 overviewWhen to use applies_to tags:✅ At the page level to indicate which products/deployments the content applies to (mandatory) What NOT to do:❌ Don't remove or replace information that applies to an older version 🤔 Need help?
|
Hey @mridula-s109 remember per the comment, that we can't just overwrite info from a previous version, we need to use applies_to tags to make it clear what changed in 9.2 without deleting any information that's relevant to 9.0 + 9.1 :) |
Ah yes, it slipped my mind. i will update the changes accordingly. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good overall, some comments on vocabulary
This retriever operates on top of two other retrievers: a `knn` retriever and a `standard` retriever. Our query structure would look like this: | ||
This retriever operates on top of two other retrievers: a `knn` retriever and a `standard` retriever. | ||
We can also specify weights to adjust the influence of each retriever on the final ranking. | ||
In this example, we're giving the lexical search twice the influence of the semantic search (kNN): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Lexical is a very search-practitioner specific term, that not everyone reading this documentation may know.
In this example, we're giving the lexical search twice the influence of the semantic search (kNN): | |
In this example, we're giving the lexical search (in the `standard` retriever) twice the influence of the semantic search (in the `knn` retriever): |
`retriever` | ||
: (Optional, a retriever object) | ||
| ||
Specifies a child retriever. Can be omitted when using the direct format (e.g., `{ "standard": {...} }`). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we make this clarification a little less ambiguous? I am not sure what "direct format" should mean and the example isn't helpful. Is there somewhere we could link for format documentation, or add additional explanation that is more clear?
`weight` | ||
: (Optional, float) | ||
| ||
The weight that each score of this retriever's top docs will be multiplied with in the RRF formula. Higher values increase this retriever's influence on the final ranking. Must be non-negative. Defaults to `1.0`. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe add something that if a weight is not specified all retrievers are equally weighted against each other?
## Example: Weighted hybrid search [rrf-retriever-example-weighted] | ||
| ||
This example demonstrates how to use weights to adjust the influence of different retrievers in the RRF ranking. | ||
In this case, we're giving more importance to lexical matches (weight 2.0) compared to vector similarity (weight 1.0): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same comment on usage of the term lexical.
Summary
Adds missing documentation for the
weight
parameter introduced with the Weighted RRF retriever (GA'd in #130658).Closes #136477
Changes
rrf-retriever.md (REST API Reference):
retriever
andweight
fieldsretrievers-examples.md (Examples Guide):
Testing
./gradlew :docs:check
passed (917 tasks completed)Checklist
gradle check
Related