We have been assigned with a task to enable searching and getting back search results for visitors from both Sitecore and old WordPress website. As Algolia was used already with existing WordPress site, we have decided to try out first implementing Algolia search provider for Sitecore. Plan B was to leverage Coveo (as it has extensive support for Sitecore) or build our custom implementation using either Solr or Azure Search search providers.
Luckily for us there was already Sitecore Search Provider for Algolia created by Dmitry Harnitski and you can find it on github. Problem was that the code supported only Sitecore 8 version and we were already on Sitecore 9.1.
You can find my implementation for Sitecore 9.1+ in this sitecore91 branch on my github: https://github.com/chorpo/Sitecore.Algolia/tree/sitecore91
I have made some significant changes:
- .NET Target Framework bumped to 4.7.2
- Sitecore referenced nuget packages bumped to Sitecore 9.1 versions
- Removed completely Algolia.Search project and replaced it with 5.2.1 version of Algolia.Search nuget which makes solution much simpler and future proof; I have used version 5.2.1 as it’s the last to use Newtonsoft.JSON 11.0.2 so same as Sitecore 9.1 uses not to have version conflicts
- Removed switches for old Sitecore 8 versions as needed for Sitecore 9.1
- Tests project also uses nuget references and I have bumped versions of used nuget packages
- Because of some compatibility issues with FluentAssertions I had to unload Tests project from solution for now (will investigate further)
- Fix issues in Tests project
- Clean up and refactor code as Stylecop shows more than 200 warnings
Enjoy and contribute!