#community-help

Troubleshooting Field Filtering Syntax in Typesense v0.24.1

TLDR Laura had an issue relating to field filtering in Typesense. After some advice and questioning from Jason, Laura realized the problem was due to their environment settings, not their field filtering query.

Powered by Struct AI
+12
12
2mo
Solved
Join the chat
Jul 07, 2023 (2 months ago)
Laura
Photo of md5-e31442d4d6c849124582a10193fe7721
Laura
07:19 PM
good afternoon, in the documentation it says that if I want to filter by OR conditions for the same field I should do "country: [USA, UK]", but if for the same field I want it to have 2 AND conditions? For example, in my schema I have a field _tags which is an array, I want to filter based on this array having at the same time "br" and "shoppable", how to do it?
Jason
Photo of md5-8813087cccc512313602b6d9f9ece19f
Jason
07:20 PM
Could you try this:

_tags:=br && _tags:=shoppable
Laura
Photo of md5-e31442d4d6c849124582a10193fe7721
Laura
07:32 PM
thanks! it still doesn't work, is it because my field is an array?
Image 1 for thanks! it still doesn't work, is it because my field is an array?
07:33
Laura
07:33 PM
when I use _tags:[br,shoppable] it brings results, but not in the logic I need
Jason
Photo of md5-8813087cccc512313602b6d9f9ece19f
Jason
07:35 PM
May I know what version of Typesense you’re using?
Laura
Photo of md5-e31442d4d6c849124582a10193fe7721
Laura
07:36 PM
yes! "typesense": "^1.5.4",
Jason
Photo of md5-8813087cccc512313602b6d9f9ece19f
Jason
07:36 PM
Sorry I meant the Typesense Server version
Laura
Photo of md5-e31442d4d6c849124582a10193fe7721
Laura
07:42 PM
Typesense v0.24.1
07:46
Laura
07:46 PM
sorry, i found the problem
07:47
Laura
07:47 PM
it was my env, but thanks for your help about filter_by fields
+11
Jason
Photo of md5-8813087cccc512313602b6d9f9ece19f
Jason
07:47 PM
May I know what the issue with your env was that fixed the issue? Were you running a different Typesense server version?
Laura
Photo of md5-e31442d4d6c849124582a10193fe7721
Laura
07:58 PM
no, in my env I am alternating the collection of documents I access, to access the products
+11