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)
Case: I want to filter documents by
date_start >= "2022-12-09" || date_start = ""
For “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|falseand then you can filter with that boolean field in your filter
Dec 10, 2022 (12 months ago)
(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 Nallan05:42 AM
Indexed 3015 threads (79% resolved)
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.