Filtering Based on Null or Specific Field Value in Typesense
TLDR Matheus asked how to filter documents on a null or specific field value. Jason suggested using a placeholder string to represent null values for filtering purposes.
Powered by Struct AI
1
2
20mo
May 13, 2022 (20 months ago)
Matheus
Matheus
04:15 PMHow do I filter where I have a field matching a given string, and where it is also null? Say, I have a optional field called visibility_options. I want to get all documents which either have "visibility_options=="complete" or dont have that field
Jason
Jason
04:16 PMTypesense does not index the absence of values. So you would have to create a special placeholder string to denote "null" and use that to filter....
1
Typesense
Lightning-fast, open source search engine for everyone | Knowledge Base powered by Struct.AI
Indexed 3015 threads (79% resolved)
Similar Threads
Troubleshooting Typesense Filter_by Parameter Issue
Sagar had trouble with the filter_by parameter in Typesense. Kishore Nallan identified issue related to indexing, which resolved part of the issue. Guidance was given for handling null values.
21
4mo
Query Regarding Null Field Filtering in Typesense
Luke asked about null field filtering, to which Kishore Nallan provided a link explaining its unavailability.
3
30mo
Querying Null and String Values in Typesense.
Andrew wondered if they could look for non-null and string values in Typesense, but Jason explained a workaround by creating a new boolean field at indexing time.
2
10mo