-
Notifications
You must be signed in to change notification settings - Fork 25.6k
Retrievers: Refactor retriever builder tests #134799
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
Retrievers: Refactor retriever builder tests #134799
Conversation
server/src/main/java/org/elasticsearch/search/retriever/CompoundRetrieverBuilder.java
Outdated
Show resolved
Hide resolved
|
Pinging @elastic/search-relevance (Team:Search - Relevance) |
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.
LGTM
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.
Nice work! I left a few comments on some small testing gaps and potential improvements.
...lugin/rank-rrf/src/test/java/org/elasticsearch/xpack/rank/AbstractRetrieverBuilderTests.java
Outdated
Show resolved
Hide resolved
...lugin/rank-rrf/src/test/java/org/elasticsearch/xpack/rank/AbstractRetrieverBuilderTests.java
Outdated
Show resolved
Hide resolved
...lugin/rank-rrf/src/test/java/org/elasticsearch/xpack/rank/AbstractRetrieverBuilderTests.java
Show resolved
Hide resolved
...plugin/rank-rrf/src/test/java/org/elasticsearch/xpack/rank/rrf/RRFRetrieverBuilderTests.java
Outdated
Show resolved
Hide resolved
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.
LGTM! I left one one non-blocking comment, do with it what you will.
| T rewrittenLinear = (T) rewritten; | ||
| assertEquals(retriever.rankWindowSize(), rewrittenLinear.rankWindowSize()); |
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.
Two nits here:
rewrittenLinearis leftover from when this was only for the linear retriever- We don't need to check
rankWindowSizehere anymore, that's done inassertCompoundRetriever
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.
thanks - just addressed this too
BASE=5ce0c649d6b0ebe7c731eb23157489e8d3c46633 HEAD=8c7939c511b854052233c03dc866f469270829d3 Branch=main
BASE=5ce0c649d6b0ebe7c731eb23157489e8d3c46633 HEAD=8c7939c511b854052233c03dc866f469270829d3 Branch=main
BASE=5ce0c649d6b0ebe7c731eb23157489e8d3c46633 HEAD=8c7939c511b854052233c03dc866f469270829d3 Branch=main
BASE=5ce0c649d6b0ebe7c731eb23157489e8d3c46633 HEAD=8c7939c511b854052233c03dc866f469270829d3 Branch=main
BASE=5ce0c649d6b0ebe7c731eb23157489e8d3c46633 HEAD=8c7939c511b854052233c03dc866f469270829d3 Branch=main
Adds an
AbstractRetrieverBuilderTeststhat copies some of the methods inLinearRetrieverBuilderTests.We then extend this abstract class in both
LinearRetrieverBuilderTestsandRRFRetrieverBuilderTestsremoving duplication and making sure we have consistent testing for both retrievers.This is a prerequisite for adding support for querying multiple indices with the RRF simplified retriever.
And I think it will also help with testing in #132680