Skip to content

fix: increase maxValuesPerFacet to fix Top Senders dashboard panel#363

Open
danielra01 wants to merge 1 commit into
LogicLabs-OU:mainfrom
danielra01:fix/top-senders-facet-limit
Open

fix: increase maxValuesPerFacet to fix Top Senders dashboard panel#363
danielra01 wants to merge 1 commit into
LogicLabs-OU:mainfrom
danielra01:fix/top-senders-facet-limit

Conversation

@danielra01
Copy link
Copy Markdown

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 maxValuesPerFacet defaults to 100, and
facet 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: 10000 in configureEmailIndex() so
Meilisearch 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 in getTopSenders() across the entire codebase.

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
@github-actions
Copy link
Copy Markdown

github-actions Bot commented May 3, 2026

All contributors have signed the CLA ✍️ ✅
Posted by the CLA Assistant Lite bot.

@danielra01
Copy link
Copy Markdown
Author

I have read the CLA Document and I hereby sign the CLA

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Dashboard 'Top Senders' returns top senders only in the alphabetically-first senders

1 participant