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
Has child query forces default similarity #16611
Conversation
@gpstathis Thanks! The change looks good. Can you squash the commits into a single commit? |
c2dc113
to
9c4a7ae
Compare
@martijnvg done! |
@@ -1926,4 +1927,51 @@ public void testHasChildInnerQueryType() { | |||
QueryBuilders.hasChildQuery("child-type", new IdsQueryBuilder().addIds("child-id"))).get(); | |||
assertSearchHits(searchResponse, "parent-id"); | |||
} | |||
|
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.
@martijnvg can we do this with a unittest HasChildQueryBuilderTests
should be able to verify this?
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.
agreed, that is better. We should just test the integration part here (whether non default similarity gets applied) and not whether right scores get computed.
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.
I'll add this test on top of this pr. For the 2.x branches we should still use the integ tests, since that is the only way to tests this stuff there.
@gpstathis I pushed this to master: b17a92c and I replaced the integration test with a unit test instead: 3290cfb When back porting to 2.x, your integration tests will guard that that the similarity is properly passed down the IndexSearcher. |
Thanks @martijnvg. |
@martijnvg, should already have a CLA signed from #4977. Closes #16550.