A Relevanssi user asked about Italian plurals on the Relevanssi support forums. The best answer is to use the Relevanssi Snowball Stemmer; it supports Italian and can handle more than plurals.
You can add a function to handle just the plurals, though. Add this to your site:
add_filter( 'relevanssi_remove_punctuation', function( $string ) {
$words = explode( ' ', $string );
$new_words = array();
foreach ( $words as $word ) {
$end = mb_substr( $word, -3 );
if ( 'ghe' === $end ) {
$word = mb_substr( $word, 0, -3 ) . 'ga';
}
if ( 'che' === $end ) {
$word = mb_substr( $word, 0, -3 ) . 'ca';
}
$end = mb_substr( $word, -1 );
if ( mb_strlen( $word ) > 3 && in_array( $end, array( 'a', 'e', 'i', 'o' ) ) ) {
$word = mb_substr( $word, 0, -1 );
}
$new_words[] = $word;
}
return implode( ' ', $new_words );
}, 10, 9 );This function checks each word, and if it ends with “ghe” or “che”, the ending is changed to “ga” or “ca”, respectively. Then if the word is over three letters long, a final “a”, “e”, “i”, or “o” is stripped. Now plural and singular forms are considered the same in the search.
Remember to rebuild the index after adding this function!