typesense / typesense-instantsearch-adapter

A JS adapter library to build rich search interfaces with Typesense and InstantSearch.js
MIT License
361 stars 62 forks source link

Correctly type `preset` parameter #169

Closed carderne closed 1 year ago

carderne commented 1 year ago

Typing issue

The additionalSearchParameters or collectionSpecificSearchParameters appears to accept a preset parameter to use Typesense Presets. But if I try:

    collectionSpecificSearchParameters: {
      collection_a: {
        preset: "preset_1",
      },
      collection_b: {
        preset: "preset_2",
      },
carderne commented 1 year ago

Sorry didn't realise how fresh this is even in typesense-js!

jasonbosco commented 1 year ago

@carderne I just published v2.7.0-5. Could you upgrade to it and see if that fixes the typing issue?

carderne commented 1 year ago

I'm still getting

Property 'query_by' is missing in type '{ preset: string; }'
but required in type 'SearchParametersWithQueryBy'
jasonbosco commented 1 year ago

Ah I missed a spot. Could you check in v2.7.0-6.

carderne commented 1 year ago

Yup, working now!