Querying Null and String Values in Typesense.
TLDR 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.
Powered by Struct AI
2
10mo
Feb 15, 2023 (10 months ago)
Andrew
Andrew
04:28 PMHow do i set a field to be able to look for a string, or null value? For instance
And have it return all documents where the videoUrl is not a null value but instead a string?
videoUrl:!=null
And have it return all documents where the videoUrl is not a null value but instead a string?
Jason
Jason
05:20 PMTypesense doesn’t have a way to do this, because it goes off of field values to build the index.
So you would have to create a new boolean field at indexing time, called say
So you would have to create a new boolean field at indexing time, called say
videoUrlIsNull
and then use that to filterTypesense
Lightning-fast, open source search engine for everyone | Knowledge Base powered by Struct.AI
Indexed 3015 threads (79% resolved)
Similar Threads
Querying Empty Strings in Typesense Cloud - Collection Search
Loic wanted to query empty strings in Typesense, but Jason explained this needs to be done when indexing as Typesense doesn't support querying blank keys.
4
14mo
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
Filtering Based on Null or Specific Field Value in Typesense
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.
2
20mo