Fix Bug in RankDocRetrieverBuilder when from is set to Default (-1)#137637
Merged
markjhoy merged 12 commits intoelastic:mainfrom Nov 7, 2025
Merged
Conversation
Collaborator
|
Pinging @elastic/search-relevance (Team:Search - Relevance) |
Collaborator
|
Hi @markjhoy, I've created a changelog YAML for you. |
Contributor
Author
|
buildkite test this |
kderusso
approved these changes
Nov 5, 2025
Member
kderusso
left a comment
There was a problem hiding this comment.
Thanks for spinning up this fix so quickly! I have one suggestion, otherwise it LGTM.
server/src/main/java/org/elasticsearch/search/retriever/RankDocsRetrieverBuilder.java
Outdated
Show resolved
Hide resolved
pmpailis
reviewed
Nov 6, 2025
...rc/yamlRestTest/resources/rest-api-spec/test/inference/70_text_similarity_rank_retriever.yml
Outdated
Show resolved
Hide resolved
pmpailis
reviewed
Nov 6, 2025
...rrf/src/internalClusterTest/java/org/elasticsearch/xpack/rank/rrf/RRFRetrieverBuilderIT.java
Outdated
Show resolved
Hide resolved
Mikep86
reviewed
Nov 6, 2025
...rc/yamlRestTest/resources/rest-api-spec/test/inference/70_text_similarity_rank_retriever.yml
Outdated
Show resolved
Hide resolved
Mikep86
reviewed
Nov 6, 2025
...rc/yamlRestTest/resources/rest-api-spec/test/inference/70_text_similarity_rank_retriever.yml
Outdated
Show resolved
Hide resolved
...rrf/src/internalClusterTest/java/org/elasticsearch/xpack/rank/rrf/RRFRetrieverBuilderIT.java
Outdated
Show resolved
Hide resolved
...rrf/src/internalClusterTest/java/org/elasticsearch/xpack/rank/rrf/RRFRetrieverBuilderIT.java
Show resolved
Hide resolved
Mikep86
approved these changes
Nov 6, 2025
Contributor
Mikep86
left a comment
There was a problem hiding this comment.
LGTM, except for the commented out code
...rrf/src/internalClusterTest/java/org/elasticsearch/xpack/rank/rrf/RRFRetrieverBuilderIT.java
Outdated
Show resolved
Hide resolved
Contributor
|
I think we should also backport this to 8.19? |
markjhoy
added a commit
to markjhoy/elasticsearch
that referenced
this pull request
Nov 7, 2025
…elastic#137637) * correct `from` in extractToSearchSourceBuilder * Update docs/changelog/137637.yaml * fix tests; simplify from check * revert auto-formatting * fix failing test; additional tests; changelog area * remove comment * [CI] Auto commit changes from spotless * cleanup unit and YAML tests * [CI] Auto commit changes from spotless * remove old, commented code --------- Co-authored-by: elasticsearchmachine <infra-root+elasticsearchmachine@elastic.co>
Collaborator
💔 Backport failed
You can use sqren/backport to manually backport by running |
markjhoy
added a commit
to markjhoy/elasticsearch
that referenced
this pull request
Nov 7, 2025
…elastic#137637) * correct `from` in extractToSearchSourceBuilder * Update docs/changelog/137637.yaml * fix tests; simplify from check * revert auto-formatting * fix failing test; additional tests; changelog area * remove comment * [CI] Auto commit changes from spotless * cleanup unit and YAML tests * [CI] Auto commit changes from spotless * remove old, commented code --------- Co-authored-by: elasticsearchmachine <infra-root+elasticsearchmachine@elastic.co> (cherry picked from commit 2e297b9) # Conflicts: # x-pack/plugin/rank-rrf/src/internalClusterTest/java/org/elasticsearch/xpack/rank/rrf/RRFRetrieverBuilderIT.java
markjhoy
added a commit
to markjhoy/elasticsearch
that referenced
this pull request
Nov 7, 2025
…elastic#137637) * correct `from` in extractToSearchSourceBuilder * Update docs/changelog/137637.yaml * fix tests; simplify from check * revert auto-formatting * fix failing test; additional tests; changelog area * remove comment * [CI] Auto commit changes from spotless * cleanup unit and YAML tests * [CI] Auto commit changes from spotless * remove old, commented code --------- Co-authored-by: elasticsearchmachine <infra-root+elasticsearchmachine@elastic.co> (cherry picked from commit 2e297b9) # Conflicts: # x-pack/plugin/rank-rrf/src/internalClusterTest/java/org/elasticsearch/xpack/rank/rrf/RRFRetrieverBuilderIT.java
Contributor
Author
💚 All backports created successfully
Questions ?Please refer to the Backport tool documentation |
elasticsearchmachine
pushed a commit
that referenced
this pull request
Nov 7, 2025
…#137637) (#137708) * correct `from` in extractToSearchSourceBuilder * Update docs/changelog/137637.yaml * fix tests; simplify from check * revert auto-formatting * fix failing test; additional tests; changelog area * remove comment * [CI] Auto commit changes from spotless * cleanup unit and YAML tests * [CI] Auto commit changes from spotless * remove old, commented code --------- Co-authored-by: elasticsearchmachine <infra-root+elasticsearchmachine@elastic.co>
markjhoy
added a commit
that referenced
this pull request
Nov 8, 2025
…t (-1) (#137637) (#137709) * Fix Bug in RankDocRetrieverBuilder when `from` is set to Default (-1) (#137637) * correct `from` in extractToSearchSourceBuilder * Update docs/changelog/137637.yaml * fix tests; simplify from check * revert auto-formatting * fix failing test; additional tests; changelog area * remove comment * [CI] Auto commit changes from spotless * cleanup unit and YAML tests * [CI] Auto commit changes from spotless * remove old, commented code --------- Co-authored-by: elasticsearchmachine <infra-root+elasticsearchmachine@elastic.co> (cherry picked from commit 2e297b9) # Conflicts: # x-pack/plugin/rank-rrf/src/internalClusterTest/java/org/elasticsearch/xpack/rank/rrf/RRFRetrieverBuilderIT.java * Fix failing test from backport * [CI] Auto commit changes from spotless --------- Co-authored-by: elasticsearchmachine <infra-root+elasticsearchmachine@elastic.co>
markjhoy
added a commit
that referenced
this pull request
Nov 8, 2025
…lt (-1) (#137637) (#137710) * Fix Bug in RankDocRetrieverBuilder when `from` is set to Default (-1) (#137637) * correct `from` in extractToSearchSourceBuilder * Update docs/changelog/137637.yaml * fix tests; simplify from check * revert auto-formatting * fix failing test; additional tests; changelog area * remove comment * [CI] Auto commit changes from spotless * cleanup unit and YAML tests * [CI] Auto commit changes from spotless * remove old, commented code --------- Co-authored-by: elasticsearchmachine <infra-root+elasticsearchmachine@elastic.co> (cherry picked from commit 2e297b9) # Conflicts: # x-pack/plugin/rank-rrf/src/internalClusterTest/java/org/elasticsearch/xpack/rank/rrf/RRFRetrieverBuilderIT.java * Fix failing test from backport * [CI] Auto commit changes from spotless * Fix backport compilation errors --------- Co-authored-by: elasticsearchmachine <infra-root+elasticsearchmachine@elastic.co>
Kubik42
pushed a commit
to Kubik42/elasticsearch
that referenced
this pull request
Nov 10, 2025
…elastic#137637) * correct `from` in extractToSearchSourceBuilder * Update docs/changelog/137637.yaml * fix tests; simplify from check * revert auto-formatting * fix failing test; additional tests; changelog area * remove comment * [CI] Auto commit changes from spotless * cleanup unit and YAML tests * [CI] Auto commit changes from spotless * remove old, commented code --------- Co-authored-by: elasticsearchmachine <infra-root+elasticsearchmachine@elastic.co>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes a bug found in the RankDocRetrieverBuilder when the default
fromvalue for the query is set to -1 (the default).In the RankDocRetrieverBuilder, when performing the
extractToSearchSourceBuilder, if the expected size + the offset (from) is greater than the number of docs, then it sets the limit to the number of docs minus thefromvalue. Without this fix, if the default is used (-1), then the expected number of docs could have an additional document in the result set.