fix: increase maxValuesPerFacet to fix Top Senders dashboard panel#363
Open
danielra01 wants to merge 1 commit into
Open
fix: increase maxValuesPerFacet to fix Top Senders dashboard panel#363danielra01 wants to merge 1 commit into
danielra01 wants to merge 1 commit into
Conversation
Meilisearch defaults maxValuesPerFacet to 100, returning facet values alphabetically. This caused the Top Senders widget to only show senders whose names begin with digits or early letters, ignoring high-frequency senders further in the alphabet. Fixes LogicLabs-OU#357
|
All contributors have signed the CLA ✍️ ✅ |
Author
|
I have read the CLA Document and I hereby sign the CLA |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #357
The Top Senders dashboard panel was only showing senders whose names begin
with digits or the letter "a", while high-frequency senders further in the
alphabet were missing entirely.
Root cause: Meilisearch's
maxValuesPerFacetdefaults to100, andfacet values are returned in alphabetical order — not by count. The
getTopSenders()query received only the first 100 senders alphabetically,then sorted those by count client-side. For large mailboxes with many unique
senders, this meant the actual top senders were never in the result set.
Fix: Set
maxValuesPerFacet: 10000inconfigureEmailIndex()soMeilisearch returns enough facet values for the client-side sort to produce
a correct top-10.
This setting only activates when a query explicitly requests facets. The
email content search does not use facets and is completely unaffected —
facets: [...]appears only ingetTopSenders()across the entire codebase.