Yesterday I started organizing the content on the site I’m building by adding categories & tags to all of the posts. In doing so, I realized that the search engine I built for the site can’t properly search categories or tags!
A while back I figured out how to add a lightweight search engine to Hexo blogs using Lunr. Now that I am using categories and more importantly tags to organize the content, I need the search engine to return results for tag searches in addition to post content searches. Lunr is set up to index an array of single-level objects, however the JSON generator I use to create this JSON file nests categories and tags. Lunr has no plans to add support for nested JSON content. Further, the mapper function the maintainer mentions in these issues won’t work for my format of JSON.
So this means changing the JSON generator. I am looking into that now and it looks like it can be a small tweak to the code…will be giving that a go. Hopefully I can get it to work!
I did half of the design section on the UX & Web Design course I’m taking.
Chingu starts tomorrow!