typesense / typesense-instantsearch-adapter

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

How to set curation via overrides? #132

Closed amamenko closed 1 year ago

amamenko commented 1 year ago

Hi, I would like to set Typesense collection overrides using this library as detailed in the Typesense curation docs for version 0.23.1.

Typesense's docs show an example as such:

client.collections('companies').overrides().upsert('customize-apple', override)

I tried to follow their lead using the typesense-instantsearch-adapter library like so:

typesenseInstantsearchAdapter.typesenseClient.collections('companies').overrides().upsert('customize-apple', override)

but I get the error

typesenseInstantsearchAdapter.typesenseClient.collections(...).overrides is not a function

so typesenseInstantsearchAdapter.typesenseClient.collections('companies') does indeed exist, but the overrides method does not.

Are overrides supported by this library at the moment and, if so, is there any documentation on how to set them up?

jasonbosco commented 1 year ago

@amamenko typesenseInstantsearchAdapter.typesenseClient is actually the SearchClient from the Typesense JS / TS library, which only supports searching and no other operations.

So to access overrides, you want to instantiate a separate Client object from the Typesense JS/TS library.