Fix subcategories links from search

This fixes broken links to subcategories from search. [Discussion on meta](https://meta.discourse.org/t/search-here-for-plugin/12663).