Skip to content
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

Fix for propagating filters from compound to inner retrievers #117914

Open
wants to merge 8 commits into
base: main
Choose a base branch
from

Conversation

pmpailis
Copy link
Contributor

@pmpailis pmpailis commented Dec 3, 2024

This PR aims to fix an issue where the inner filters are not properly added to the children of compound retrievers if they require different number of rewrite rounds.

@pmpailis pmpailis added >bug :Search Relevance/Ranking Scoring, rescoring, rank evaluation. auto-backport Automatically create backport pull requests when merged v8.16.2 v8.17.1 v8.18.0 labels Dec 4, 2024
@elasticsearchmachine
Copy link
Collaborator

Hi @pmpailis, I've created a changelog YAML for you.

this.rankWindowSize = rankWindowSize;
this.rankDocs = rankDocs;
if (sources == null || sources.isEmpty()) {
throw new IllegalArgumentException("sources must not be null or empty");
}
this.sources = sources;
this.preFilterQueryBuilders = preFilterQueryBuilders;
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The prefilters were not actually used anywhere for the RankDocsRetrieverBuilder as they had already been accounted for when computing the parent results.

@pmpailis pmpailis marked this pull request as ready for review December 4, 2024 08:46
@elasticsearchmachine elasticsearchmachine added the Team:Search Relevance Meta label for the Search Relevance team in Elasticsearch label Dec 4, 2024
@elasticsearchmachine
Copy link
Collaborator

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

@pmpailis
Copy link
Contributor Author

pmpailis commented Dec 4, 2024

run elasticsearch-ci/part-3

Copy link
Member

@benwtrent benwtrent left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you add a test that exposes the bug? My understanding was that it appeared when using a top level filter with a query_vector_builder in kNN. Lets add a test for that somewhere. It can be a simple single node test (not yaml).

To make the query vector builder stuff easier to test, you can maybe add a "test query vector builder" that simply returns a constant vector.

@pmpailis
Copy link
Contributor Author

pmpailis commented Dec 4, 2024

Could you add a test that exposes the bug? My understanding was that it appeared when using a top level filter with a query_vector_builder in kNN. Lets add a test for that somewhere. It can be a simple single node test (not yaml).

To make the query vector builder stuff easier to test, you can maybe add a "test query vector builder" that simply returns a constant vector.

That's a good idea. The query_vector_builder is a sub-case of the actual bug, but it wasn't so straightforward to add it as a yaml test. Will add a standard single node test instead as suggested, thanks! :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
auto-backport Automatically create backport pull requests when merged >bug :Search Relevance/Ranking Scoring, rescoring, rank evaluation. Team:Search Relevance Meta label for the Search Relevance team in Elasticsearch v8.16.2 v8.17.1 v8.18.0 v9.0.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants