#community-help

Typesense Complex Filtering Syntax Queries

TLDR J asked about developing complex filter queries in Typesense. Kishore Nallan stated that Typesense doesn't currently support this feature, but it might be added in the future.

Powered by Struct AI
4
30mo
Solved
Join the chat
Mar 16, 2021 (30 months ago)
J
Photo of md5-051f535431ff484f44f165e9a0b696a5
J
02:18 PM
👋 Hi everyone!, I've run into an issue, I'm trying to filter by something like this, "a and ((b and c) or d)", could someone tell me how exactly to construct the filter query
Kishore Nallan
Photo of md5-4e872368b2b2668460205b409e95c2ea
Kishore Nallan
03:53 PM
J Typesense does not support such complex filtering syntax yet. To achieve this, you might have to encode the condition as a generated boolean field when you index the document and then just filter on this generated field.
J
Photo of md5-051f535431ff484f44f165e9a0b696a5
J
04:47 PM
Thanks, Is there any plan to add it in future?
Mar 17, 2021 (30 months ago)
Kishore Nallan
Photo of md5-4e872368b2b2668460205b409e95c2ea
Kishore Nallan
09:27 AM
Yes, but not in the immediate roadmap. This will require creating a more advance filtering syntax with a proper parse tree and require running each record through the parse tree to evaluate the compound expression like the one you have provided.