Filtering Attribute to Exclude Specific City
TLDR Atul asked how to filter a city attribute excluding 'Berlin.' Kishore Nallan suggested it's not possible directly but to use a string array and !=.
1
Mar 01, 2023 (7 months ago)
Atul
07:47 PMWe have an attribute called
{"city":"Berlin Chennai Pune Mumbai"}
and i want to apply a filter like:
filter_by=city:!Berlin
means, city not contains Berlin
.Is it possible?
If yes, please help.
Mar 02, 2023 (7 months ago)
Kishore Nallan
01:36 AMfilter_by=city:!= Berlin
Atul
05:38 AMThis is not
contains (like)
, this is equals (=)
Atul
05:39 AMcity
not contains Berlin
Kishore Nallan
05:49 AMAtul
06:51 AMYou are right
thanks
Kishore Nallan
06:52 AM1
Typesense
Indexed 2776 threads (79% resolved)
Similar Threads
Querying MultiSearch with Typesense
Alex inquired about performing parallel multiSearch in Typesense, wanting to replicate an SQL query. Kishore Nallan informed them that multi_search executes parallel searches independently, and recommended using the `filter_by` clause. However, regular expressions and prefix search cannot be used in filters.
Typesense Cloud Filter Expression Issue
Samuel experienced a "Filter expression is not valid" error on a previously working query. Kishore Nallan assisted in troubleshooting and discovered it was a Scoped Search token formatting issue on Samuel's end.
Implementation and Testing of Negative Filtering on Typesense
Stefan needed an ETA on implementing negative filtering on layer of `typesense`. Kishore Nallan provided updates, fixes, and an early build for testing. Further plans on adding it to instantsearch adapter were discussed, with Stefan also offering to contribute.