Last active
November 7, 2016 15:58
-
-
Save jchristopher/8552354 to your computer and use it in GitHub Desktop.
Tell SearchWP to use a different stemmer when generating keyword stems
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// Tell SearchWP we have a stemmer | |
add_filter( 'searchwp_keyword_stem_locale', '__return_true' ); | |
function my_searchwp_custom_stemmer( $unstemmed ) { | |
$stemmer = new My_Stemmer(); // use your own custom stemmer | |
$stemmed = $stemmer->get_stem( $unstemmed ); // get the stem | |
return $stemmed; | |
} | |
add_filter( 'searchwp_custom_stemmer', 'my_searchwp_custom_stemmer' ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment