#community-help

Character Limit when Generating Scope Search Key

TLDR Facundo inquired about character limits for scoped search keys with large filters. Jason stated there was no limit but recommended using the 'multi_search' method for long keys.

Powered by Struct AI

1

1

Aug 10, 2023 (4 months ago)
Facundo
Photo of md5-acdab31d3dfb1b3ccd497a43ef2fe0d1
Facundo
03:59 PM
Hello there! I would like to ask: Is there a character limit for generating a scoped search key? Let's say I would like to add 200 filters for that scoped key.

client.keys().generateScopedSearchKey(keyWithSearchPermissions, {'filter_by': 'company_id:124', 'expires_at': 1906054106})

Thanks!
Jason
Photo of md5-8813087cccc512313602b6d9f9ece19f
Jason
11:15 PM
No, there’s no character limit
11:16
Jason
11:16 PM
But if you generate a long scoped api key, you want to use multi_search and put the scoped api key in the post body insides searches[].x-typesense-api-key
11:17
Jason
11:17 PM
because HTTP headers do have a max size, and get parameters are restricted to 2K characters in Typesense.

Whereas the POST body doesn’t have these limits

1

Aug 11, 2023 (4 months ago)
Facundo
Photo of md5-acdab31d3dfb1b3ccd497a43ef2fe0d1
Facundo
12:48 PM
Thanks!

1