Snowball Stemmer

The simple English stemmer provided in Relevanssi Premium is simple and does not work very well – it’s just a simple suffix stripper, and not a proper stemmer.

If you want a proper stemmer, you can install the Relevanssi Premium Snowball Stemmer add-on plugin. This plugin implements a proper stemmer for over dozen languages. The stemmer used is the Wamania native PHP stemmer, this plugin just makes it easy to use with Relevanssi Premium.

Current language support

Catalan · Danish · Dutch · English · French · German · Italian · Norwegian · Portuguese · Romanian · Russian · Spanish · Swedish

Installing the plugin

The best way to install this plugin is as a Composer package from GitHub. That way you can get access to updates, in case the Wamania PHP stemmer is updated.

The plugin GitHub page is here, with instructions on how to add the plugin as a Composer dependency. (Make sure the plugin dependencies are also installed; that may not happen automatically.)

If you can’t use Composer, you can download the plugin here. This version does not include any automatic update functionality, but on the other hand, it probably doesn’t require much updating in the first place.

Requirements

Using this plugin properly requires Relevanssi Premium 2.10.3.

It’s possible to use the plugin with older versions of Relevanssi Premium, but in that case you can’t access the settings page and need to change the language by adjusting the options manually. English is the default language, so if you’re happy with that, you’ll be fine.

Notes on shortcomings

Stemming can cause problems with partial matching. For example with a post that talks about “pinning”, the stemmer stems that to just “pin”.

The upside is that now search terms like “pins”, “pinnings” and so on will find the post, as they are also stemmed to “pin”, but as a downside something like “pinnin” does not find the post. “Pinnin” does not get stemmed to “pin” and as the word “pinning” isn’t indexed at all, partial matching doesn’t work either.

This also makes the “Did you mean” suggestions work less well, as “pinnin” is so far from “pin” that it doesn’t get the correct suggestion, like it would if “pinning” were indexed.

This will be fixed in future. Relevanssi Premium 2.10.4 and Snowball Stemmer 1.1 will change this so that both the original word and the stemmed word are indexed, which will get solve this problem.

Highlighting with stemming does not work as well as it could. If you have partial matching enabled, Relevanssi will highlight the stem of the word, but not the whole word. The ideal solution would be to highlight the whole word. That’s somewhat more complicated to do to than highlight just the part of the word, but I’ll look into improving this in a future version of Relevanssi.