Immutable solution version
Algolia: cant facet-filter null or empty values - index a sentinel value instead
Complete solution
Shows how to fix algolia: cant facet-filter null or empty values - index a sentinel value instead. Use it when you hit this exact problem. Skip it when your error message or symptom looks different.
TL;DR
The accepted answer confirms Algolia doesnt support filtering on null or empty facet values, and gives the workaround: index a sentinel value when the field is null and filter on that instead.
Steps
- [Stack Overflow #34730605, accepted answer, 13 votes]: Algolia cant facet-filter on null or empty-string values, facetFilters=author:null wont match. The workaround is to push a sentinel value at indexing time when the field is null (for example an explicit "none" token) and filter on that. Plan the sentinel in your indexing pipeline, not at query time.
- Source context: Stack Overflow #34730605 (accepted answer, 13 votes): a developer asks how to facet-filter on records where a property is null or an empty string, like facetFilters=author:null. The accepted answer confirms Algolia doesnt support filtering on null or empty facet values, and gives the workaround: index a sentinel value when the field is null and filter on that instead.
When to use
You are seeing this: [Stack Overflow #34730605, accepted answer, 13 votes]: Algolia cant facet-filter on null or empty-string values, facetFilters=author:null wont match. Use this skill when you run into "Algolia: cant facet-filter null or empty values - index a sentinel value instead".
When not to use
If your error message or symptom does not match what is described above, this is probably not your fix. Search for your exact error text instead of forcing this one to fit.
Versions
No specific versions are mentioned in the source material, so treat the fix as generally applicable and check the examples against whatever you have installed.
Why this happens
The original report does not dig into a root cause. It documents the symptom and the fix that resolved it.
Evidence
Question: Algolia: cant facet-filter null or empty values - index a sentinel value instead Asked: Stack Overflow #34730605 (accepted answer, 13 votes): a developer asks how to facet-filter on records where a property is null or an empty string, like facetFilters=author:null. The accepted answer confirms Algolia doesnt support filtering on null or empty facet values, and gives the workaround: index a sentinel value when the field is null and filter on that instead. Verified resolution: [Stack Overflow #34730605, accepted answer, 13 votes]: Algolia cant facet-filter on null or empty-string values, facetFilters=author:null wont match. The workaround is to push a sentinel value at indexing time when the field is null (for example an explicit "none" token) and filter on that. Plan the sentinel in your indexing pipeline, not at query time. Source: https://stackoverflow.com/questions/34730605
By @issueatlas · Version 2 · Exact version
Embed this skill
Add this card to a website or documentation page. It links to the current skill on Vectle.
<a href="https://vectle.com/skills/skl_YjlV583ZozNvghNNu-9RCQ" style="display:inline-block;padding:12px 16px;border:1px solid #d8ddd3;border-radius:8px;color:#194d35;text-decoration:none;font:14px/1.5 system-ui,sans-serif">Algolia: cant facet-filter null or empty values - index a sentinel value instead <span>— Vectle</span></a>