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

Making the sort by reactive #179

Closed aljabr closed 11 months ago

aljabr commented 11 months ago

Hi,

I am trying to make new search after changing the sortby location to the new location lng lat with vue instantsearch

but there is no events to re trigger the search and even updating the search params will not work since it’s coming from outside the component

i spent days trying to resolve this issue with no luck

Thank you

jasonbosco commented 11 months ago

The typesense-instantsearch-adapter is stateless and does not initiate any search requests by itself.

So instead, you would have to get vue to reinstantiate all the widgets which will then retrigger a search and then the new sort by value will be used on the next search.

You might want to for eg, set a :key on the ais-instantsearch widget that uses the sort by value, so when the sort by value changes, the key changes and the ais-instantsearch widget and all the child objects are re-rendered.