#community-help

Clarification and Solution for 'not equals filter_by' Configuration

TLDR Alex asked about filter syntax in Typesense. Kishore Nallan clarified that the version being used caused the issue and offered to upgrade their dev cluster to resolve it.

Powered by Struct AI
17
25mo
Solved
Join the chat
Oct 28, 2021 (25 months ago)
Alex
Photo of md5-faf0fdba0b6739a6706f05c15b6738c6
Alex
10:13 AM
Hi there! I am trying to use the new “not equals filter_by” configuration. I can’t make it work by using the syntax provided in the docs - filter_by=author:!= JK Rowling . However, i think it works with this syntax - filter_by=author:-= JK Rowling . Are the docs wrong or do i have issues with my setup? Thanks!
Kishore Nallan
Photo of md5-4e872368b2b2668460205b409e95c2ea
Kishore Nallan
10:14 AM
👋 May I know what version of Typesense you are using? You can hit /debug end-point to find that.
10:28
Kishore Nallan
10:28 AM
filter_by=author:!= JK Rowling is the correct syntax, though we experimented with the "-" very early on, with some debug builds but it was never published. When you use :-= it will just be treated equals since everything after : will be treated as part of filter value and during tokenization, those special characters will be dropped.
11:13
Kishore Nallan
11:13 AM
Alex
Alex
Photo of md5-faf0fdba0b6739a6706f05c15b6738c6
Alex
11:28 AM
Hi Kishore!
{"state":1,"version":"0.21.0.rc7"}
11:28
Alex
11:28 AM
:-= works though 😮
Kishore Nallan
Photo of md5-4e872368b2b2668460205b409e95c2ea
Kishore Nallan
11:28 AM
Ah that must be it. It's an early RC build, which might have been rolled out for some other reason which also happened to have the early design for exclusion filters.
Alex
Photo of md5-faf0fdba0b6739a6706f05c15b6738c6
Alex
11:29 AM
Oh 😄
Kishore Nallan
Photo of md5-4e872368b2b2668460205b409e95c2ea
Kishore Nallan
11:29 AM
We moved away from using - because it conflicted with genuine use of hyphens.
11:30
Kishore Nallan
11:30 AM
0.22.0 is going to be out soon, we should migrate your cluster once 0.22 is out to the GA release.
Alex
Photo of md5-faf0fdba0b6739a6706f05c15b6738c6
Alex
11:31 AM
Okey nice. If i need the change now, can we upgrade our cluster to 0.21 meanwhile?
Kishore Nallan
Photo of md5-4e872368b2b2668460205b409e95c2ea
Kishore Nallan
11:32 AM
Yes, sure. If you can just test against 0.21 GA locally and ensure that everything is fine, we can upgrade you.
Alex
Photo of md5-faf0fdba0b6739a6706f05c15b6738c6
Alex
11:37 AM
Yes sure. Do you have time to upgrade our dev cluster now? 79bnji2m3qwera6sp-1.a1.typesense.net
Kishore Nallan
Photo of md5-4e872368b2b2668460205b409e95c2ea
Kishore Nallan
11:38 AM
We usually schedule these upgrades (hoping to self service them soon) since some of them requires collaboration with customer. Is it okay if we do it within the next day?
Alex
Photo of md5-faf0fdba0b6739a6706f05c15b6738c6
Alex
11:48 AM
I understand. Yes, the url is sent you is our dev/test cluster, so the time is not important.
Later, when it is time to bump our prod cluster, then it would be nice to schedule it so we can put up a maintenance banner on our site :thumbsup:
Kishore Nallan
Photo of md5-4e872368b2b2668460205b409e95c2ea
Kishore Nallan
11:49 AM
👍 Okay I will update this thread once the dev cluster listed above is upgraded to 0.21
Alex
Photo of md5-faf0fdba0b6739a6706f05c15b6738c6
Alex
11:50 AM
Perfect thanks!