We are using instantsearch in react, along with in...
# community-help
e
We are using instantsearch in react, along with infinite hits. This is an old class based component that we are migrating from Algolia. We have everything working accept the sort_by feature. We’re using a normal (non Algolia) dropdown which dynamically changes the ‘sort_by’ parameter and causes a query to fire off. This works and results are returned, but the ‘hits’ remain the same as they were. If we select a facet dropdown (which is an instantsearch widget), new results are pulled through with the sort too. Otherwise, the hits remain as they were. We can see the network request so we know the hits we expect to come through are there, and the component is rendered, but the hits don’t change
j
@Edward Sparks When you say "normal (non Algolia) dropdown", you're still using the instantsearch connectors to build this custom widget right? That's the only way (AFAIK) to get instantsearch to integrate with other custom UI elements...
e
We stopped using the dropdown when we implemented typesearch as for some reason we never got results back and saw errors everytime we tried to use the 'connectSortBy'
message has been deleted
Once removed, we started getting hits returned. But then the sort_by functionality has not worked as expected. If we use 'Hits' instead of 'infiniteHits' our non-Algolia connected dropdown works flawlessly, but our component is based on infinite scrolling
j
That 404 error might be fixable. I haven't used connectSortBy but I suspect the 404 might be because with the Typesense adapter you need to specify the index name in a specific way for sort by to work. For eg, here's the format for the default sortBy widget: https://github.com/typesense/typesense-instantsearch-adapter#sortby Could you try setting the index name similarly in your custom widget?
e
🙏
that solved it. thank you so much.
👍 1
j
Awesome! 🙌
🙌 1