Creating Scoped Search Keys with OR Condition
TLDR Sai asked about creating scoped search keys with OR conditions. Jason confirmed they must create two different keys or pre-compute the OR at indexing time.
Powered by Struct AI

4
12mo
Solved
Sep 23, 2022 (12 months ago)
Sai
Sai
01:17 PMHi - If I’d want a scoped search key that has embedded filters of an OR condition across different fields, I have to be creating two different scoped keys here is it?
Jason
Jason
01:49 PMCorrect. You can embed a separate x-typesense-api-key param inside each search in a multi search request
01:50
Jason
01:50 PMAlternatively, if you can precompute the OR somehow at indexing time into a single field, that might be easier
Sai
Sai
02:12 PMThanks Jason!

Typesense
Lightning-fast, open source search engine for everyone | Knowledge Base powered by Struct.AI
Indexed 2764 threads (79% resolved)
Similar Threads
Query on Generating Search Keys with Cross-field ORs
Sai asked if cross-field ORs can be embedded in scoped search keys. Kishore Nallan clarified that this is currently not supported.
3
12mo
Solved
Creating Filters for Scoped Search Keys
Jeremy inquired about encapsulating filters for multiple collections into one search key. Jason confirmed the need to create one scoped api key per collection.

2
15mo
Solved
Adding OR Statement in filter_by of apiKey scope
Danny asks about adding an OR statement to filter values in two fields. Jason informs that Typesense doesn't yet support it but suggests splitting the query across a multi_search request.

7
14mo
Solved