Allowing non-existence on a filtered term in ElasticSearch with tire
I have a boolean field that I'm trying to filter by, but I want to fetch documents that either have a specific value for this field, or doesn't have this field populated at all. How can I accomplish this?
There are two ways of dealing with it. First of all, you can use null_value attribute in the mapping to specify how null value should be indexed. Alternatively, you can use exists or missing filters along with bool or or filters to augment your query.