Skip to content

Conversation

mridula-s109
Copy link
Contributor

@mridula-s109 mridula-s109 commented Oct 16, 2025

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):

  • Added sub-parameters section documenting retriever and weight fields
  • Added weighted hybrid search example showing weight usage
  • Follows linear-retriever.md documentation patterns

retrievers-examples.md (Examples Guide):

  • Updated main RRF example to demonstrate weighted retrievers
  • Shows semantic search (weight 2.0) and lexical search (weight 1.0)

Testing

  • ./gradlew :docs:check passed (917 tasks completed)
  • Documentation-only changes

Checklist

Related

@mridula-s109 mridula-s109 requested review from a team, Copilot, leemthompo and pmpailis October 16, 2025 13:50
@mridula-s109 mridula-s109 self-assigned this Oct 16, 2025
@mridula-s109 mridula-s109 added >docs General docs changes Team:Docs Meta label for docs team :SearchOrg/Relevance Label for the Search (solution/org) Relevance team Team:Search Relevance Meta label for the Search Relevance team in Elasticsearch labels Oct 16, 2025
Copy link
Contributor

@Copilot Copilot AI left a 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 and weight 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.

@elasticsearchmachine elasticsearchmachine added v9.3.0 Team:Search - Relevance The Search organization Search Relevance team and removed Team:Search Relevance Meta label for the Search Relevance team in Elasticsearch labels Oct 16, 2025
@elasticsearchmachine
Copy link
Collaborator

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

@elasticsearchmachine
Copy link
Collaborator

Pinging @elastic/core-docs (Team:Docs)

Copy link
Contributor

github-actions bot commented Oct 16, 2025

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?

@leemthompo
Copy link
Contributor

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 :)

@mridula-s109
Copy link
Contributor Author

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.

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.

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):
Copy link
Member

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.

Suggested change
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": {...} }`).
Copy link
Member

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`.
Copy link
Member

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):
Copy link
Member

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

>docs General docs changes :SearchOrg/Relevance Label for the Search (solution/org) Relevance team Team:Docs Meta label for docs team Team:Search - Relevance The Search organization Search Relevance team v9.3.0

4 participants