Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Algolia facet filter by empty/null value

Tags:

facet

algolia

Is there a way to filter hits by a property's value that is either null or an empty string?

i.e., show me all objects that do not have an author

facetFilters=author:null

facetFilters=author:''

Or include it in a list of OR values?

i.e., show me all objects with author set to Twain or that do not have an author

facetFilters=(author:Twain,author:null)

facetFilters=(author:Twain,author:'')

like image 383
George Hess Avatar asked Jan 11 '16 20:01

George Hess


1 Answers

Unfortunately - as of today - Algolia doesn't support that. One work-around could be to push an extra value if it's null, like pushing author: 'unknown' that you could use to filter on.

like image 114
redox Avatar answered Nov 01 '22 05:11

redox