Sitecore Commerce search integration with Algolia
Hi, if you haven’t heard about Algolia — I highly recommend to learn about it. It’s blazing fast cloud search service with powerful APIs and great UI, that could replace SOLR or Azure Search for your Sitecore instance.
And there is already an implementation of Algolia provider for Sitecore search which could be used:
However there is one space missing — Sitecore Commerce search that I’m going to fill.
For that I’ve created a custom plugin that can replace SOLR search in Sitecore Commerce engine
Here is how to use the Algolia search for Sitecore Commerce:
To replace SOLR/Azure provider with Algolia we reference the Plugin.Commerce.Search.Algolia plugin from the repository in our engine solution.
If you dont have the solution yet there is a great article on how to do that:
Now lets configure Algolia API keys in our application for the provider
For this we need to add new policy file and then bootstrap Sitecore Commerce engine:
Now the plugin will automatically replace the SOLR search implementation with Algolia one.
All left to do is to configure the search indexable fields.
For this we have 3 pipeline blocks that could be replaced in our application that are responsible for indexing respectively catalog, category and sellable items:
- InitializeAlgoliaCatalogIndexingViewBlock
- InitializeAlgoliaCategoryIndexingViewBlock
- InitializeAlgoliaSellableItemIndexingViewBlock
By replacing them and implementing BuildCustomProperties method we could define additional properties that would end up in Algolia indexes.
Now you can have Sitecore Commerce index in Algolia! Enjoy!