Please note that this Support article contains frontend customizations via modifying the legacy Algolia template files, which are deprecated and unsupported by the Algolia Support Team.
For more information, please review this Support article - "Why is modifying Algolia template files for customizations not supported?"
There may be instances where the facets appear to not be displaying all of the available options. For instance, an e-commerce shop may have shoes of sizes 8, 9, 10, 11, 12, and 13. However, it's possible only 10, 12, and 13 are displayed despite the remaining sizes being in-stock.
This can occur if "Show products instead of variants" has been selected.
When the query is sent, the query-time parameter "facetingAfterDistinct" is set to true. This means that the search is first performed, then the size variants are deduplicated, and then the facet sizes are determined (in that order.) So the front-end is essentially receiving de-duplicated facet counts.
This can be changed by altering the algolia_instant_search.js file in the theme code to set the "facetingAfterDistinct" parameter to false at query time. So within the addWidgets function in that file, it should read:
instant.search.addWidgets([
configure({
hitsPerPage: instant.hitsPerPage,
clickAnalytics: true,
facetingAfterDistinct: false,
}),
]);
This will ensure the facets are determined prior to the results being deduplicated. Please bear in mind, however, that the sum of all facet counts may now exceed the number of displayed results.