Andre Rubnikowich
Andre Rubnikowich

Reputation: 475

ElasticSearch stemmer not giving the root word

How do I get the stemmer to tokenize " great, greater, greatest" to it's root word. I've tried using the snowball, kterm, stemmer but all seems to tokenizer the word as is. I would expect it to be "great".

Here's the mapping for ElasticSearch 7.

{"book": {
  "mappings": {
    "properties": {
      "title":{
          "type":"text",
          "analyzer":"search_string_analyzer"
      }
    }
  },
  "settings":{
    "index":{
      "analysis":{
        "filter":{
          "eng_stemmer":{"type":"stemmer","language":"english"},
          "eng_stop":{"type":"stop","stopwords":["_english_"]},
          },

      "analyzer":{
        "search_string_analyzer":{
          "filter":["lowercase",
                  "eng_stop","asciifolding","eng_stemmer"],
                   "type":"custom","tokenizer":"standard"
        }
      }
    },
  }
}

Upvotes: 0

Views: 265

Answers (1)

Kumar V
Kumar V

Reputation: 1660

Looks like none of the standard stemmers does this conversion. May be custom stemming could be an option? https://www.elastic.co/guide/en/elasticsearch/reference/current/analysis-stemmer-override-tokenfilter.html

Upvotes: 1

Related Questions