-
Notifications
You must be signed in to change notification settings - Fork 528
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(disjunctive): prefer values of main query for facet count #6445
Conversation
This is relevant in two cases: - second query is non-exhaustive - second query is not correct due to facet count after distinct There's still more edge cases left (first query non exhaustive, but second isn't, but that's unlikely) and those are not worse after this PR.
This pull request is automatically built and testable in CodeSandbox. To see build info of the built libraries, click here or the icon next to each commit SHA. Latest deployment of this branch, based on commit 4f2b466:
|
packages/algoliasearch-helper/test/spec/SearchResults/getFacetValues.js
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.
This works great for disjunctive refinements. Looking at the customer issue again, they experience this on a conjunctive refinement, which is not covered by this fix. Do you want to handle this in a subsequent PR or can you add it here?
How could they have this issue on a conjunctive facet? there's only one query there |
@dhayab fixed now for hierarchical too, but only if persistHierarchicalRootCount is true, other cases seemed to break a lot of tests |
Nice, thanks! |
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.
This works, thank you!
Summary
Use the values of the main facet in disjunctive facets
This is relevant in two cases:
There's still more edge cases left (first query non exhaustive, but second isn't, but that's unlikely) and those are not worse after this PR.
Result
disjunctive facets read the count from the first query over the ones from the second query. This is already the case for hierarchical facets.