# Better French and German stemming?

**URL:** https://discuss.elastic.co/t/better-french-and-german-stemming/236283
**Category:** Elasticsearch
**Created:** [June 9, 2020, 8:25am UTC](https://discuss.elastic.co/t/better-french-and-german-stemming/236283 "2020-06-09T08:25:28Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![bkazez](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/bkazez/32/25991_2.png) [@bkazez](https://discuss.elastic.co/u/bkazez)
#### Post date: [June 9, 2020, 8:25am UTC](https://discuss.elastic.co/t/better-french-and-german-stemming/236283/1 "2020-06-09T08:25:28Z")

</div>

Hello,

I'm using [cloud.elastic.co](http://cloud.elastic.co) to index metadata about German and French baroque vocal music. I need to treat inflected and uninflected forms as equivalent, so someone can search "schlummer" and find the lovely Bach aria "Schlummert ein."

I expected to have to add some baroque verb forms, but the built-in stemmers are missing even modern forms. What can I do?

Settings:

```
        "analyzer_full_text_de": {
          "filter": [
            "straighten_apostrophes",
            "lowercase",
            "stop_de",
            "german_normalization",
            "stemmer_de",
            "synonyms_de"
          ],
          "type": "custom",
          "tokenizer": "standard"
        },
        "stemmer_de": {
          "name": "german",
          "type": "stemmer"
        },
        "synonyms_de": {
          "type": "synonym_graph",
          "synonyms": [
            "helfen, hilfen"
          ]
        },
        "analyzer_full_text_fr": {
          "filter": [
            "straighten_apostrophes",
            "elision_fr",
            "lowercase",
            "stop_fr",
            "stemmer_fr",
            "remove_accents"
          ],
          "type": "custom",
          "tokenizer": "standard"
        },
        "stop_fr": {
          "type": "stop",
          "stopwords": "_french_"
        },
        "elision_fr": {
          "type": "elision",
          "articles": [
            "l",
            "m",
            "t",
            "qu",
            "n",
            "s",
            "j",
            "d",
            "c",
            "jusqu",
            "quoiqu",
            "lorsqu",
            "puisqu"
          ],
          "articles_case": "true"
        },
        "stemmer_fr": {
          "name": "french",
          "type": "stemmer"
        },
        "straighten_apostrophes": {
          "pattern": "’",
          "type": "pattern_replace",
          "replacement": "'"
        }

curl -X POST "localhost:9200/.../_analyze?pretty" -H 'Content-Type: application/json' -d'
{
  "analyzer": "analyzer_full_text_de",
  "text": "schlummern schlummert gegrüsst grüssen grussen"
}'

```

=\> schlumm, schlummert, gegrusst, gruss, gruss.  
I need schlummern/schlummert =\> schlumm and gegrüsst =\> gruss.

```
curl -X POST "localhost:9200/.../_analyze?pretty" -H 'Content-Type: application/json' -d'
{
  "analyzer": "analyzer_full_text_fr",
  "text": "mal maux"
}'

```

=\> mal, maux.  
I need maux =\> mal.

The other stemmers for these languages didn't work better. What else can I do?

Thanks!  
Ben

---

<div class="post-metadata">

### Author: ![bkazez](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/bkazez/32/25991_2.png) [@bkazez](https://discuss.elastic.co/u/bkazez)
#### Post date: [June 18, 2020, 8:33am UTC](https://discuss.elastic.co/t/better-french-and-german-stemming/236283/2 "2020-06-18T08:33:42Z")

</div>

To clarify the French issue: the French stemmers "light\_french" and "french" both work for many -aux examples like animal=animaux. The bug is that they do not understand mal=maux, which makes me worry that they're missing other common examples.

---

<div class="post-metadata">

### Author: ![dadoonet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dadoonet/32/137187_2.png) [@dadoonet](https://discuss.elastic.co/u/dadoonet)
#### Post date: [June 18, 2020, 10:01am UTC](https://discuss.elastic.co/t/better-french-and-german-stemming/236283/3 "2020-06-18T10:01:14Z")

</div>

May be you should open an issue [in Lucene](https://issues.apache.org/jira/browse/LUCENE) as the `french` analyzer is provided by Lucene?

Otherwise, you can look at [https://www.elastic.co/guide/en/elasticsearch/reference/current/analysis-snowball-tokenfilter.html](https://www.elastic.co/guide/en/elasticsearch/reference/current/analysis-snowball-tokenfilter.html)? May be it will be better?

---

<div class="post-metadata">

### Author: ![bkazez](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/bkazez/32/25991_2.png) [@bkazez](https://discuss.elastic.co/u/bkazez)
#### Post date: [June 18, 2020, 2:12pm UTC](https://discuss.elastic.co/t/better-french-and-german-stemming/236283/4 "2020-06-18T14:12:32Z")

</div>

Thanks for the reply, @dadoonet. I tried the Snowball token filter but got the same results, I think because the French and German stemmers use Snowball behind the scenes. I'll open as issue in Lucene.

---

<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: [July 16, 2020, 2:12pm UTC](https://discuss.elastic.co/t/better-french-and-german-stemming/236283/5 "2020-07-16T14:12:39Z")

</div>

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