Solutions for Filtering and Comparing Data in Typesense
TLDR Jason needed to filter data in Typesense. Jason suggested using unix timestamps for comparison and creating a new field for empty records. Kishore Nallan confirmed the syntax for cross-field ORs.
Dec 09, 2022 (12 months ago)
Jason
07:43 PMCase: I want to filter documents by
date_start
where date_start >= "2022-12-09" || date_start = ""
Jason
07:44 PMFor “is empty”, Typesense doesn’t have a way to filter these records directly. You would instead have to create a new field that’s computed by you at indexing time, for eg
is_date_start_empty: true|false
and then you can filter with that boolean field in your filterJason
07:45 PMDec 10, 2022 (12 months ago)
Jason
07:45 AMJason
07:46 AMJason
03:56 PMJason
05:05 PM(field1 := condition || field2 := condition)
? and can it be cross field on the same field e.g. feild1 >= 123 || field1 := 0
?Dec 11, 2022 (12 months ago)
Kishore Nallan
05:42 AMTypesense
Indexed 3015 threads (79% resolved)
Similar Threads
Typesense: Support for OR Filters on One Field
Juliusz asked if Typesense supports OR filters on one field and shared their use case. Kishore Nallan confirmed that regular OR filtering does work but inter-field filtering on the same record isn't supported.
Queries on String Sorting, Filter_by Operators and Typesense updates
Ishan asked about OR operators in TypeSense's filter_by fields and string sorting. Kishore Nallan clarified these functionalities. A workaround was proposed for cross-field ORs by Jason. This is on TypeSense's mid-term roadmap.
Filtering by Unix Timestamps in Typesense
Nathan asked if it's possible to filter using current time in Typesense. Jason confirmed filtering requires generating and passing current unix timestamp from the client.
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.
Resolving Algolia Filter Issue with Empty/Null Strings
Mateo was struggling with a filtering error when dealing with empty/null strings in Algolia. Upon Jason's suggestion, they changed empty values to "Unknown" and exported the documents to resolve the issue.