Using Main web search on all store locations

Our site divers-supply.com we set up 5 stores. 4 being the retail locations and 1 is the main website. When we installed algolia search it created 5 sets of indexes for each store. We only sell from the main store online so even if they search from the retail locations it pushes them to the main store(s) items and inventory. I have disabled the search in magento for each store and enabled it for the main.

Can I load the main website search for all the stores? So if you choose a store location the search in the header uses the main website?

1 Like

Hello @markmcnatt,

if I understand correctly you want to run indexing only from the main website and use the main website indices for search on retail stores.

This is doable, however it requires tweaking the extension little bit.
The index name which should targeted by the search is defined in configuration.phtml file. The index name is a combination of the store’s index prefix and the code of the store. This mechanism ensures that each store targets its own indices.

What you can do is to override this line to always use the same base index name (index prefix + code of the main store). Then all stores will target the main store’s indices.

Is that OK for you?

2 Likes

hi @jan.petr

Thanks,
We have made the above changes. But Algolia search is not showing if algolia configration is disabled for the other stores.
If i enable it for other stores, will it index the products to algolia?

Hello @sasikiran.k,

you’re right. To make it work, just remove this condition to include front-end scripts on your retail stores.

1 Like

Hi @sasikiran.k and @markmcnatt,

I made a pull request to change this behavior. Would you mind trying it? Please let me know if it doesn’t fix your problem.