Estimated reading time: 7 minute(s)

I improved our on-site search here at The New Leaf Journal by installing and configuring the free version of the Relevanssi search plugin. Below, I will explain why I did this and how it helps readers like you find interesting content among our nearly 600 articles, microposts, and pages.

To Start: How To Use Our Search

Before I explain how we improved The New Leaf Journal’s search functionality and what that means for you, I ought to highlight where you will find our search box.

For computer users, the search box will appear in the top right sidebar unless you minimize the window containing The New Leaf Journal. On mobile devices and small screens, the search box will appear beneath the content. However, in desktop mode, it will be in the sidebar.

You can also search The New Leaf Journal directly from your web browser’s address bar (most browsers, at least). To search from your address box, append your search query to the end of the following URL:

https://thenewleafjournal.com/search/[YOUR-QUERY-HERE]

(Omit the square brackets when you replace the last section with your query.)

You can also add The New Leaf Journal to your browser’s list of search engines and assign it a shortcut. The GET-URL for The New Leaf Journal is:

https://thenewleafjournal.com/?s=%s

The following also works for most browsers:

https://thenewleafjournal.com/search/%s

I discussed the process of adding custom search engines to a browser in brief in my articles on the Wutsearch Search Engine Launchpad and on alternative search engines. You can consult the instructions for your specific browser to learn how to add The New Leaf Journal or any other custom search engine to your list.

Finally, you can also bypass our search entirely and use a dedicated third-party search engine to search The New Leaf Journal. I discussed how this works in my article on using DuckDuckGo to conduct domain-specific searches.

On WordPress Search

I published a micropost on April 7 to note the changes to our on-site search. Our site, like much of the web, runs on WordPress. WordPress is a very powerful content management system with an emphasis on blogging. It comes with a default search feature for searching content on a specific site. The problem with the default search is that it is bad – very bad. If you never tried our on-site search before, take it from someone who used it on occasion to try to find articles that he wrote while using very specific searches. The results were underwhelming to say the least.

Our on-site search was so lackluster that I am fairly sure that I did not include a visible search box for the entirety of The New Leaf Journal’s existence – although I have kept a search box up more often than not.

Alternative Solutions

WordPress is highly extensible through plugins. To explain succinctly, WordPress comes with core features – that is, things built directly into WordPress that are available to every site running WordPress. In addition to WordPress’s core functionality – and themes (every WordPress site has a theme), which include their own functionality. One way to add functionality beyond the WordPress core and theme is by installing plugins. I maintain a list of useful plugins that we use (or have used in the past) here on site.

For the past few months, I had been using a lightweight search plugin called Relevanssi Light. It added full-text search functionality to the default search and allowed pages to appear in search results along with articles. It made our search marginally better but it did not move the needle much. There are ways to configure Relevanssi Light, but I did not have time to dig into them.

The author of Relevanssi Light notes on the plugin page that it is a very limited version of his more robust search plugin, Relevanssi.

What Prompted the Switch?

Relevanssi Light did improve our default search, but it was limited without my digging into the configuration in a way that I was not inclined to do. However, while I do not have analytics information on our search, but I can infer that very few visitors take advantage of it. For that reason, a more robust solution was not a high priority for me.

The situation changed when I added our Leaflet Micropost custom post type last week. I wanted a search solution that would do a good job of indexing and including our new leaflet microposts along with the main body of articles and pages. I figured that if I was going to put the time in to figure that out, I ought to improve the search wholesale.

Settling on Relevanssi

I consider several things when evaluating plugins for potential use on The New Leaf Journal. See the following list for some of my considerations:

  • Is the plugin frequently updated?
  • Do tests reveal any errors with the plugin in the current version of WordPress?
  • Does the author of the plugin have a well-established track record?
  • Does the plugin collect information about users or rely on third parties?
  • Does the plugin negatively affect site performance (i.e., slower page load times, make the site heavier)?
  • Does it work without Javascript enabled?
  • Does the plugin add database tables to WordPress?

One reason I liked Relevanssi Light was because it checked these boxes. I dug into search plugins on WordPress and decided to consider those that added database tables. While I prefer plugins that do not add database tables – I only had two prior to installing Relevanssi – with one being our privacy-friendly local search solution, Koko Analytics. I figured that I could splurge a bit on making our search useable.

While Relevanssi does add a few database tables, available tests indicated that it does not have any negative impact on page load times and also that it uses very little memory. Unlike Relevanssi Light, it includes a number of configuration options such as determining which posts and post types are included in the search, how search results should be weighed, and some additional user-interface options for searchers.

Finally, Relevanssi is frequently updated and its developer, Mikko Saari, offers a premium version of the plugin. I noted that Relevanssi is more frequently updated than Relevanssi Light.

With nothing to lose, I uninstalled Relevanssi Light and installed Relevanssi.

Configuring Relevanssi

Relevanssi includes a number of useful options in its menus. Before having the plugin index all of my content, I carefully went through the settings to configure it according to our needs. I adjusted the weight of different elements from the default settings and modified a few other settings. I enabled a neat feature for “custom search result snippets” – this means that returns for search queries will show a snippet of text with the search term in bold instead of the article’s default description. This will make it easier for searchers to determine whether a specific article is relevant to their query.

Relevanssi includes some analytics functionality – but it correctly comes disabled by default. I am not interested in tracking search queries – so I left all logging disabled.

Assessment

I am very impressed with our new search functionality with Relevanssi thus far. I tested a number of searches and found that it delivers relevant results. I may adjust the weights a bit over time, but I think that the search as it stands now is a useful tool for sifting through our volumes of content.

Screenshot of a Relevanssi-powered search result page on a WordPress magazine called The New Leaf Journal.
Screenshot of a search for the word “whyever” using our new and improved Relevanssi-powered WordPress search. Note that instead of showing the default descriptions for each article, the results highlight where the query (in this case, “whyever”) appears in the content. I captured this screenshot in the Badwolf web browser. Note my nifty AmigaOS-inspired window border – I covered that in an earlier article.

The excerpt feature – which was disabled by default — is also very handy. For example, if you decided to search for Rome or Roman History, seeing the context in which it appears in the article should help you determine which result is most responsive to your query.

Notes On Using the Search

Do note that our search is not really designed to handle questions. Its purpose is to see when a specific word or phrase showed up in our articles. We do have partial matching enabled – so in most cases it will return something related to your query.

Why Not Alternative Solutions?

Many sites use a third party solution for on-site search. Google is the most common search engine for this purpose, but I explained in an earlier article that DuckDuckGo can be used in this way as well. However, I do not want to send New Leaf Journal visitors to a third party to search for content on The New Leaf Journal, so I ruled out these options.

One option that intrigued (and still intrigues) me is Yacy. Yacy is a decentralized search engine where individual users run their own web crawlers. Digital Ocean published a 2014 article discussing how to use Yacy as a single-site search. I would be interested in trying it – but this goes a bit beyond my technical capabilities and is not entirely amenable to our server set-up. Moreover, I do not think that the effort for uncertain returns is worth it given the generally limited use of our search feature.

Finally, I could purchase a premium search solution – including Relevanssi Pro. However, search plugins are expensive – for example, Relevanssi Pro costs more than a year’s worth of VPS hosting for The New Leaf Journal and more than our SEO plugin, both of which are far more important (essential, in the first case) to the functioning of The New Leaf Journal. Since the site does not generate revenue with ads and not all that many visitors use our search, I opted against spending money to improve the WordPress search. For a different project though, a paid solution like Relevanssi Pro would be worth considering, if not essential.

Conclusion

I am satisfied with our new Relevanssi-powered search and I wish I had implemented it sooner. I hope you give it a try when you read an article that interests you and are curious if I have covered any related subjects. Be sure to check out our new and improved “related posts” section under our articles for content suggestions based on the article that you are reading.