relevanssi_disable_stemmer / relevanssi_enable_stemmer

Relevanssi-compatible stemmers are expected to implement these action hooks. They are simple: relevanssi_disable_stemmer should disable the stemmer temporarily and relevanssi_enable_stemmer should enable the stemmer. These action hooks are used in the Relevanssi searching process so that Relevanssi can figure out what parts of the search query are from stemmer and which are not.

More information

Implementing these action hooks is straightforward if you are using the relevanssi_stemmer filter hook. Just add or remove the filter function. The Relevanssi Snowball Stemmer does it like this:

add_action(
	'relevanssi_disable_stemmer',
	function() {
		remove_filter( 'relevanssi_stemmer', 'relevanssi_premium_snowball_stemmer' );
	}
);

add_action(
	'relevanssi_enable_stemmer',
	function() {
		add_filter( 'relevanssi_stemmer', 'relevanssi_premium_snowball_stemmer' );
	}
);