When working with Algolia, you may notice discrepancies or inconsistencies with facet counts and hit counts in your search results. There are several reasons why these issues can occur, and understanding the root cause is key to resolving them. Below is a checklist of common issues, each with a root cause and a link to a detailed article for further reading.
In some cases, multiple factors can contribute to discrepancies in facet and hit counts. We recommend reviewing each scenario below, as more than one may apply to your situation.
Do you really need facet counts? Before delving in to how to fix facet count discrepancies, it's worth considering whether it's necessary to show them at all. Research has shown that users tend to use facets as binary on/off decisions, not to compare inventory quantities. The count next to a filter option doesn't tend to change whether someone will click it.
Common facet and hit count issues
Issue: The hit count in your API response does not match the count shown in the Algolia dashboard
-
Root cause: Your query parameter excludes the facets parameter
Article: How the facets parameter affects hit count accuracy in Algolia
-
-
Root cause 2: You have set 'after distinct' on an attribute for faceting
-
Root cause 3: You have set 'facetingAfterDistinct' as a query-time parameter on all attributes
-
Root cause 4: You have set 'removeWordsIfNoResults' to All optional.
-
Root cause 5: Non-exhaustive hit and facet counts
Article: Why are my facet and hit counts/number of results not accurate?
If you encounter facet or hit count discrepancies, review each of these articles to identify which scenario matches your situation and follow the recommended solutions.