# How to use the root of Spanish words for searches?

**URL:** <https://discuss.elastic.co/t/how-to-use-the-root-of-spanish-words-for-searches/280558>\
**Category:** Kibana\
**Created:** [August 5, 2021, 4:30pm UTC](https://discuss.elastic.co/t/how-to-use-the-root-of-spanish-words-for-searches/280558 "2021-08-05T16:30:10Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![JavierArevalo](https://avatars.discourse-cdn.com/v4/letter/j/bc79bd/32.png) [@JavierArevalo](https://discuss.elastic.co/u/JavierArevalo)\
**Post date:** [August 5, 2021, 4:30pm UTC](https://discuss.elastic.co/t/how-to-use-the-root-of-spanish-words-for-searches/280558/1 "2021-08-05T16:30:10Z")

</div>

I need to search my documents by words, I want to obtain all the documents related to a word and its derivations in Spanish, for example: if I search for "flor" I want to obtain all the documents related to the words: "florero", "florar", "florecer", "florista" , "florido", "enflorar".

I was using Stemmer and snowball filters configured for Spanish language, but I don't get good results. For example:

Config:

```auto
"filter" : {
            "my_snowball" : {
              "type" : "snowball",
              "language" : "spanish"
            }
}

```

Test:

```auto
GET test4/_analyze
{
  "tokenizer": "whitespace",
  "filter": ["my_snowball"],
  "text": "florero florar florecer florista florido"
}

```

Result:

```auto
{
  "tokens" : [
    {
      "token" : "florer",
      "start_offset" : 0,
      "end_offset" : 7,
      "type" : "word",
      "position" : 0
    },
    {
      "token" : "flor",
      "start_offset" : 8,
      "end_offset" : 14,
      "type" : "word",
      "position" : 1
    },
    {
      "token" : "florec",
      "start_offset" : 15,
      "end_offset" : 23,
      "type" : "word",
      "position" : 2
    },
    {
      "token" : "florist",
      "start_offset" : 24,
      "end_offset" : 32,
      "type" : "word",
      "position" : 3
    },
    {
      "token" : "flor",
      "start_offset" : 33,
      "end_offset" : 40,
      "type" : "word",
      "position" : 4
    }
  ]
}

```

and stemmer:  
Config:

```auto
"filter" : {
            "my_stemmer_spanish" : {
              "type" : "stemmer",
              "language" : "spanish"
            }
}

```

Test:

```auto
GET test4/_analyze
{
  "tokenizer": "whitespace",
  "filter": ["my_stemmer_spanish"],
  "text": "florero florar florecer florista florido"
}

```

Result:

```auto
"tokens" : [
    {
      "token" : "florer",
      "start_offset" : 0,
      "end_offset" : 7,
      "type" : "word",
      "position" : 0
    },
    {
      "token" : "flor",
      "start_offset" : 8,
      "end_offset" : 14,
      "type" : "word",
      "position" : 1
    },
    {
      "token" : "florec",
      "start_offset" : 15,
      "end_offset" : 23,
      "type" : "word",
      "position" : 2
    },
    {
      "token" : "florist",
      "start_offset" : 24,
      "end_offset" : 32,
      "type" : "word",
      "position" : 3
    },
    {
      "token" : "flor",
      "start_offset" : 33,
      "end_offset" : 40,
      "type" : "word",
      "position" : 4
    }
  ]
}

```

---

<div class="post-metadata">

**Author:** ![tsullivan](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/tsullivan/32/31077_2.png) [@tsullivan](https://discuss.elastic.co/u/tsullivan)\
**Post date:** [August 12, 2021, 6:13pm UTC](https://discuss.elastic.co/t/how-to-use-the-root-of-spanish-words-for-searches/280558/2 "2021-08-12T18:13:39Z")

</div>

Hi, I think you meant to post this in the Elasticsearch category of discussions: [Elasticsearch - Discuss the Elastic Stack](https://discuss.elastic.co/c/elastic-stack/elasticsearch/6)

---

<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 9, 2021, 6:13pm UTC](https://discuss.elastic.co/t/how-to-use-the-root-of-spanish-words-for-searches/280558/3 "2021-09-09T18:13:59Z")

</div>

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