Multiple autocomplete input fields (each for different indice)

Hello, did some searching from the forum but could not find a similar case from the past, so here we go :slight_smile:

We are having 3 main categories of products which are all indexed to Algolia as separate indices, the question is how can we display 3 separate autocomplete input fields on one page in WordPress and return hits only from one indice at time?

Example:
Input #1 > Return hits from Cars
Input #2 > Return hits from Bikes
Input #3 > Return hits from Busses

We tried adding the following code directly: https://www.algolia.com/doc/tutorials/search-ui/autocomplete/auto-complete/ But it seems that the active WordPress plugin overrides the configuration and all input fields keep returning results from the default indice.

We also read the following topics, but none of them were actually answering the frontend question we are facing:



Any help received would be highly appreciated, thank you in advance! :slight_smile:

Hi there,

Can you setup a codesandbox.io example of what you are trying to accomplish? Use one of the templates found here: https://github.com/algolia/create-instantsearch-app#previews

Then we can work to figure out a solution outside of WP that you’ll be able to apply.

Thanks!
Jason

Hi @jason.sooter1 :slight_smile: Thanks for the advise, codesandbox.io is a great tool! :smiley:

After some sleep we actually managed to create what we were looking at codesandbox.io: https://codesandbox.io/s/4jzzm6nyw0

So we basically need 3 search inputs, which each are assigned for an individual index.

The question remains, how can we create additional search inputs with the WordPress plugin?

@rayrutjes Are you aware of how they can create additional search inputs (3 separate) with the WordPress plugin? Thanks!

1 Like

Unfortunately the plugin has not be designed to support multiple customized search inputs.
In order to achieve that you would need to create a custom implementation based on one of our frontend libraries directly.