Search code examples
drupal-8porter-stemmer

Porter Stemmer Module doesn't stem "milder" & "mild" words


I have installed Porter Stemmer v8.x-2.2 module with read me instructions. It doesn't stem few words on Drupal 8 site search

  1. "mild" [working for milder]
  2. "south" [working for southern]

Solution

  • I got this from module maintainer

    This is expected behavior of the Porter stemmer, unfortunately. If you examine the list provided on https://tartarus.org/martin/PorterStemmer/output.txt , you'll see that "milder" does not stem down to "mild". In other words, it is not an issue in the Drupal implementation. The recommended solutions include:

    (A) adding your own additional implementation of hook_search_preprocess() that manually stems certain words in the manner you want, for the vocabulary that is important on your site

    (B) Use the contributed search_api module for your site search, which includes a Porter stemmer option with a UI to add additional keyword stems

    It looks good.