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

5
19mo
Solved
Feb 02, 2022 (19 months ago)
Aapo
Aapo
11:54 AMHi 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
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.
Aapo
Aapo
11:57 AMCan I use it in the “q” parameter?
Kishore Nallan
Kishore Nallan
11:58 AMNo,
q
parameter is a free text search which does not support conditions. Only the filter_by supports that syntax.Aapo
Aapo
11:58 AMOk, thanks!
Typesense
Lightning-fast, open source search engine for everyone | Knowledge Base powered by Struct.AI
Indexed 2764 threads (79% resolved)
Similar Threads
Query Logic in 'q' Parameter
A had a question about using AND and OR in the 'q' parameters. Jason clarified that 'filter_by' should be used for structured search instead.

7
20mo
Solved
Query Language 'Or' Filtering Feature Discussion
Iulian asked for ‘or’ filtering in the query language with Typesense. Kishore Nallan informed it's targeted for the year end. Jason provided a temporary workaround.


6
22mo
Solved
Querying Multiple String Requirements on a Single Field
Todd had a query on string requirements on a single field using the 'q' parameter. Jason clarified and guided suggesting using `filter_by=field:word1` for desired results.



10
15mo
Solved