#community-help

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

1

Sep 23, 2022 (15 months ago)
Sai
Photo of md5-b9327d0862b35ce6892410a50cfa1514
Sai
01:17 PM
Hi - 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
Photo of md5-8813087cccc512313602b6d9f9ece19f
Jason
01:49 PM
Correct. You can embed a separate x-typesense-api-key param inside each search in a multi search request
01:50
Jason
01:50 PM
Alternatively, if you can precompute the OR somehow at indexing time into a single field, that might be easier
Sai
Photo of md5-b9327d0862b35ce6892410a50cfa1514
Sai
02:12 PM
Thanks Jason!

1