typesense / typesense-js

JavaScript / TypeScript client for Typesense
https://typesense.org/docs/api
Apache License 2.0
414 stars 75 forks source link

There is no option of selecting `limit_multi_searches` in `multiSearch` using typescript. #162

Open MarkoRisticSting opened 1 year ago

MarkoRisticSting commented 1 year ago

Description

There is no option of selecting limit_multi_searches in multiSearch using typescript.

Steps to reproduce

typescript complains

Screenshot 2023-06-20 at 20 49 44

Expected Behavior

To already have option for limit_multi_searches in MultiSearchRequestSchema We can see that it is missing.

Screenshot 2023-06-20 at 20 52 52

Actual Behavior

TS2345: Argument of type { collection: string; limit_multi_searches: number; }' is not assignable to parameter of type 'Partial<MultiSearchRequestSchema>.

Metadata

1.5.4

Mac OS

jasonbosco commented 1 year ago

Ah, will fix the types for this. On a side note, even though the multi_search endpoint supports limit_multi_searches, I would recommend embedding it in a Scoped Search API key, so it cannot be modified.

MarkoRisticSting commented 1 year ago

Thanks for quick response. Does it makes sense to add it to GenerateScopedSearchKeyParams also? @jasonbosco

jasonbosco commented 1 year ago

Yeah, I'll probably just add limit_multi_searches only to GenerateScopedSearchKeyParams to encourage recommended usage of this param.

jasonbosco commented 1 year ago

Could you try this with v1.6.0-1?

MarkoRisticSting commented 1 year ago

Typescript doesn't complain anymore, let me figure out how Scoped Search API key works now 😂 thanks again.

Screenshot 2023-06-20 at 22 22 44
MarkoRisticSting commented 1 year ago

Looks like x-typesense-api-key when sent as query param is not overriding default x-typesense-api-key, so my limit is not increased? @jasonbosco Any idea?

Screenshot 2023-06-21 at 10 25 30