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

Invalid facet counts returned when adding a filter #4634

Open
Kerollmops opened this issue May 14, 2024 · 0 comments
Open

Invalid facet counts returned when adding a filter #4634

Kerollmops opened this issue May 14, 2024 · 0 comments
Labels
bug Something isn't working as expected

Comments

@Kerollmops
Copy link
Member

Kerollmops commented May 14, 2024

Meilisearch returns invalid facet counts in the facet distribution. When a filter is added to a query some of the facet counts increase. This issue is directly related to this Cloud issue (internal link) and you can find the datasets and settings there.

To Reproduce

  1. Send a simple query: {"q":"glam","filter":[],"facets":["tags"],"page":0}
  2. Look at the facet counts: {"backpack": 9, "bag": 15}
  3. Send the same query with a filter: {"q":"glam","filter":[["tags = \"backpack\""]],"facets":["tags"],"page":0}
  4. Look at the facet counts increase: {"backpack": 43, "backpacking": 1, "bag": 43}
  5. Send the another query with another filter: {"q":"glam","filter":[["tags = \"backpack\"", "tags = \"bag\""]],"facets":["tags"],"page":0}
  6. Look at the facet counts increase again: {"backpack": 43, "backpacking": 1, "bag": 67}

Expected behavior
The facet count must be more precise/stable and must even decrease if you constrain the query more with filters. By using page: 0 or a very high limit, the engine must be exhaustive on the facet counts.

Meilisearch version:
v1.8.0

Additional context
On the Cloud, but probably not related.

@Kerollmops Kerollmops added the bug Something isn't working as expected label May 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working as expected
Projects
None yet
Development

No branches or pull requests

1 participant