#community-help

Creating Filters for Scoped Search Keys

TLDR Jeremy inquired about encapsulating filters for multiple collections into one search key. Jason confirmed the need to create one scoped api key per collection.

Powered by Struct AI

1

Jun 22, 2022 (18 months ago)
Jeremy
Photo of md5-96cc31eb35a2f90daace11c06b18f0d1
Jeremy
01:08 AM
For Scoped Search Keys, are you able to create filters on a per collection basis. For example, I have a user that has access to collections movies and actors but only if the movies are published and the actors are alive , which are facets on movies and actors respectively. Is there a way for me to encapsulate this into one scoped search key, or will i need to create two scoped search keys, one for each collection?
Jason
Photo of md5-8813087cccc512313602b6d9f9ece19f
Jason
03:26 AM
You would have to create one scoped api key per collection and you can include the x-typesense-api-key field in each search in a multi search request (as of v0.23.0)

1