I wanted to move away from the default google search that came with my blog theme for a while now. Finally, I found time and some solutions I can build upon to do this in a nice way.
Even though the Hexo theme I’m using offers some search options, I didn’t like any of them. I really like the #jamstack movement, and I’m exploring #serveless options in azure so I wanted to do something with those technologies. I stumbled upon this pretty recent solution built with React, Azure Functions and Azure Cognitive Search. This was a perfect starting point since I also used Azure Cognitive Search in the past to build the Cognitive CMS project, so I know how powerful it is.
After installing the plugin and running
hexo azuresearch all of my blog posts were added to the Azure Cognitive Search Index and I was able to explore and query the index with the official Azure Cognitive Search Visual Studio Code Extension.
You can see the end result by trying out search in the header or clicking here.
In the process I made two small pull requests
And I made my solutions open source
I plan to use this stack in the future to build even more solutions, but until then I hope this shows how powerful it can be to add these serverless features like Azure Cognitive Search to a static web site.