# Differences between light\_spanish and spanish stemmers

**URL:** <https://discuss.elastic.co/t/differences-between-light-spanish-and-spanish-stemmers/280366>\
**Category:** Elasticsearch\
**Created:** [August 3, 2021, 8:10pm UTC](https://discuss.elastic.co/t/differences-between-light-spanish-and-spanish-stemmers/280366 "2021-08-03T20:10:34Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Daniel\_Rojas](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/daniel_rojas/32/77845_2.png) [@Daniel\_Rojas](https://discuss.elastic.co/u/Daniel_Rojas)\
**Post date:** [August 3, 2021, 8:10pm UTC](https://discuss.elastic.co/t/differences-between-light-spanish-and-spanish-stemmers/280366/1 "2021-08-03T20:10:34Z")

</div>

We're using the `light_spanish` stemmer, but we've had some issues with some specific words, for example, if I search "papa", it doesn't show results that contain "papas". So, I tested the `spanish` stemmer, and it solves those problems, but since we have a large operation, I need to know what are the differences in practice between those two algorithms. Sure, these specific problems are solved with this algorithm, but I don't know if other words will be stemmed incorrectly and cause similar issues in the future.

In any case, if we keep having issues only with some words, we can use this and add custom mappings for those words: [Stemmer override token filter | Elasticsearch Guide [7.14] | Elastic](https://www.elastic.co/guide/en/elasticsearch/reference/current/analysis-stemmer-override-tokenfilter.html)

Another question, even the `spanish` stemmer doesn't seem to work with 3 characters or less, for example, if I search "ajo", it doesn't show results that have the word "ajos", is there a solution for this? Other than adding custom mappings like I said above?

Thanks.

---

<div class="post-metadata">

**Author:** ![spinscale](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/spinscale/32/25011_2.png) [@spinscale](https://discuss.elastic.co/u/spinscale)\
**Post date:** [August 4, 2021, 9:07am UTC](https://discuss.elastic.co/t/differences-between-light-spanish-and-spanish-stemmers/280366/2 "2021-08-04T09:07:08Z")

</div>

So, there are indeed two different implementations under the hood. See [lucene/SpanishStemmer.java at main · apache/lucene · GitHub](https://github.com/apache/lucene/blob/main/lucene/analysis/common/src/java/org/tartarus/snowball/ext/SpanishStemmer.java) and [lucene/SpanishLightStemmer.java at main · apache/lucene · GitHub](https://github.com/apache/lucene/blob/main/lucene/analysis/common/src/java/org/apache/lucene/analysis/es/SpanishLightStemmer.java)

As you can see in the first lines of code in the latter stemmer, everything with a length of 5 is returned as is and not stemmed at all. That explains your above behaviour.

If you want to test and debug a little how those stemmers behave, you can always go with the Analyze API, see [Analyze API | Elasticsearch Guide [7.13] | Elastic](https://www.elastic.co/guide/en/elasticsearch/reference/7.13/indices-analyze.html)

As an example

```auto
GET _analyze
{
  "text": [
    "Cómo te llamas?"
  ],
  "tokenizer": "standard",
  "filter": [
    {
      "type": "stemmer",
      "language": "spanish"
    }
  ]
}

GET _analyze
{
  "text": [
    "Cómo te llamas?"
  ],
  "tokenizer": "standard",
  "filter": [
    {
      "type": "stemmer",
      "language": "light_spanish"
    }
  ]
}

```

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [September 1, 2021, 9:08am UTC](https://discuss.elastic.co/t/differences-between-light-spanish-and-spanish-stemmers/280366/3 "2021-09-01T09:08:06Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
