#community-help

Querying Documents with "OR"

TLDR Aapo queried about making "OR" searches across documents for specific terms. Kishore Nallan clarified that OR search is limited to the same field and doesn't support free text search in the "q" parameter.

Powered by Struct AI
+11
5
19mo
Solved
Join the chat
Feb 02, 2022 (19 months ago)
Aapo
Photo of md5-a236b41edfc07e008b136a3939b4c0e8
Aapo
11:54 AM
Hi all, just posted an issue on Github but this might be a better place for asking… is it possible to do queries like “cat OR dog” that would search for documents that contain “cat” or “dog”?
Kishore Nallan
Photo of md5-4e872368b2b2668460205b409e95c2ea
Kishore Nallan
11:57 AM
👋 OR queries within the same field can be done like this: name: [cat, dog] but we don't support OR queries across fields.
+11
Aapo
Photo of md5-a236b41edfc07e008b136a3939b4c0e8
Aapo
11:57 AM
Can I use it in the “q” parameter?
Kishore Nallan
Photo of md5-4e872368b2b2668460205b409e95c2ea
Kishore Nallan
11:58 AM
No, q parameter is a free text search which does not support conditions. Only the filter_by supports that syntax.
Aapo
Photo of md5-a236b41edfc07e008b136a3939b4c0e8
Aapo
11:58 AM
Ok, thanks!