Toogle index in search provider react search-ui

We are building an search experiance for an eccomerce platform. We have a few different content types (different document types) indexed in a few diffrent indicies.

We have tried a few different approaches without any luck to change the current index being used by the search provider but nothing seems to be working, it keep sending the search request to the first index that it was initialized with.

Switching between two diffent indices

Last attemt was to create a whole new AppSearchAPIConnector with new searchKey and engineName in but that didn’t work either.

TheAppSearchAPIConnector is changed but nex search is done towards old index url, with throws an error since the field set is different

Any ideas on how to toggle the index and make a new search at the same time

@elastic/search-ui: 1.5.1
@elastic/search-ui-app-search-connector: 1.5.1

Working example would be great.

Thank you for a good product!

Hi artcups,

It looks like meta engines would solve the problem you're after. Here's a blog post walking through an example use case.

Meta engines require a Platinum License, so I'm not sure if you have access to the feature. If not, I understand that it's possible to support this use case with a bit of custom routing code and components to pull it all together. I unfortunately don't have experience in this area to provide more detail, but wanted to jump on this post in case meta engines are something your team can leverage.

Hey artcups,

I actually build a quick demo to show how to query multiple App search engines using the SearchUI, you can see the source code here. In this demo, I use the React router to switch context for each different App search engine.

Hope this helps.

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.