Class EnglishPluralStemFilter.EnglishPluralStemmer

java.lang.Object
org.opensearch.analysis.common.EnglishPluralStemFilter.EnglishPluralStemmer
Enclosing class:
EnglishPluralStemFilter

public static class EnglishPluralStemFilter.EnglishPluralStemmer extends Object
Plural stemmer for English based on the EnglishMinimalStemFilter

This stemmer removes plurals but beyond EnglishMinimalStemFilter adds four new suffix rules to remove dangling e characters:

  • xes - "boxes" becomes "box"
  • sses - "dresses" becomes "dress"
  • shes - "dishes" becomes "dish"
  • tches - "watches" becomes "watch"
See https://github.com/elastic/elasticsearch/issues/42892

In addition the s stemmer logic is amended so that

  • ees->ee so that bees matches bee
  • ies->y only on longer words to that ties matches tie
  • oes->o rule so that tomatoes matches tomato but retains e for some words eg shoes to shoe
  • Field Details

    • oesExceptions

      public static final char[][] oesExceptions
    • chesExceptions

      public static final char[][] chesExceptions
  • Constructor Details

    • EnglishPluralStemmer

      public EnglishPluralStemmer()
  • Method Details

    • stem

      public int stem(char[] s, int len)