Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GenerateScopedSearchKeyParams missing collection #119

Open
DanSnow opened this issue May 20, 2022 · 2 comments
Open

GenerateScopedSearchKeyParams missing collection #119

DanSnow opened this issue May 20, 2022 · 2 comments

Comments

@DanSnow
Copy link

DanSnow commented May 20, 2022

Description

I think the collection definition is probably missing here

https:/typesense/typesense-js/blob/master/src/Typesense/Keys.ts#L12

Steps to reproduce

Expected Behavior

Can use collection to generate a scoped search key

Actual Behavior

Type error

Metadata

Typsense Version:

OS:

@jasonbosco
Copy link
Member

jasonbosco commented May 20, 2022

@DanSnow collection is actually not a parameter that's applicable to scoped API Keys. Instead, you want to set permissions for specific collections at the level of the parent API key.

Could you expand on your use case for expecting collection here?

@DanSnow
Copy link
Author

DanSnow commented May 22, 2022

Thanks for the explanation. My colleague told me that collection exists and it works here. So I thought it is just a mistake in the type defination.

Our use case is: We have a static site generator to generate multiple sites. And we used TypeSense as the search provider which stores all the articles across all the sites. We want to limit the search only to a specific site.

So I'm supposed to limit the collection in the parent API key and adding collection to scoped key parameter doesn't actually work. Did I understand correctly?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants