My blog now has a long-coveted search function.
“Finally, a search function!” I decided to build it after the umpteenth time where I wanted to use the functionality only to remember I still hadn't made it.
You can find the search bar via the blog main page, which you can navigate from the website's main menu. It works without JavaScript (I might add an autocomplete feature One Day™️) and should also work on mobile.
How does it work?
The search tries to find matches according to five criteria and assigns them by weight, the lowest weight being the highest priority. The criteria are:
- Title contains search query
- Summary contains search query
- Content contains search query
- Related tag title starts with search query
- Assigned category title starts with search query
Search by word is case-insensitive. For now, there is no weight difference between full-word and partial-word matches.
Other changes
You might notice that several older articles have been updated today. Now, there are tags on all articles that were missing them.
You will find article tags at the bottom of an article page, alongside the article's category. I've also updated the look-and-feel of the tags to look more like… tags.
Wrap-up
Enjoy this new feature on my website; may it help you find articles even faster!