# German stemmer - Cistem und Caumann stemmer

**URL:** https://discuss.elastic.co/t/german-stemmer-cistem-und-caumann-stemmer/210047
**Category:** Elasticsearch
**Created:** [December 1, 2019, 5:22am UTC](https://discuss.elastic.co/t/german-stemmer-cistem-und-caumann-stemmer/210047 "2019-12-01T05:22:40Z")
**Posts on this page:** 13
**Page:** 1

<div class="post-metadata">

### Author: ![htsr](https://avatars.discourse-cdn.com/v4/letter/h/bbce88/32.png) [@htsr](https://discuss.elastic.co/u/htsr)
#### Post date: [December 1, 2019, 5:22am UTC](https://discuss.elastic.co/t/german-stemmer-cistem-und-caumann-stemmer/210047/1 "2019-12-01T05:22:41Z")

</div>

The stem algorithms available for German in Elasticsearch perform not good. But there are alternatives. Namely Apache Lucene/Solr offers already the [GermanStemmer](https://lucene.apache.org/core/7_2_0/analyzers-common/org/apache/lucene/analysis/de/GermanStemmer.html) based on the Caumann stemming algorithm. There is the newer [Cistem](https://github.com/LeonieWeissweiler/CISTEM) stemmer, too. This stemmer is already available for [NLTK](https://www.nltk.org/_modules/nltk/stem/cistem.html). The authors of the Cistem stem algorithm compared the different stem algorithms and it seems the Caumann and Cistem stemmers are the best stem algorithms for German (see the study [results](https://www.cis.uni-muenchen.de/~weissweiler/cistem/)). Are there any plans to incorporate these two stemming algorithms into Elasticsearch or will it be the only option to write a custom plugin in order to use one of these German stemmers.

---

<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: [December 2, 2019, 10:02am UTC](https://discuss.elastic.co/t/german-stemmer-cistem-und-caumann-stemmer/210047/2 "2019-12-02T10:02:14Z")

</div>

The GermanStemmer is available via the `german_stem` token filter, as that one uses a `GermanStemFilter`, which in turn uses the `GermanStemmer`.

For the Cistem stemmer you would need to write your own plugin...

---

<div class="post-metadata">

### Author: ![htsr](https://avatars.discourse-cdn.com/v4/letter/h/bbce88/32.png) [@htsr](https://discuss.elastic.co/u/htsr)
#### Post date: [December 3, 2019, 3:39pm UTC](https://discuss.elastic.co/t/german-stemmer-cistem-und-caumann-stemmer/210047/3 "2019-12-03T15:39:20Z")

</div>

Thanks for the reply.

I couldn't find any information about the _GermanStemmer_/_GermanStemFilter_ in the elasticsearch documenation.  
(Is there any reference to this stem filter in the official documentation?)

I tried the Cistem stemmer via a custum plugin, too.  
For example the words _Wunsch, Wünsche, gewünscht_ and _wünschen_ where all reduced to the same stem (_wunsch_). The Caumann stemmer didn't do that.  
But both stemmers seem to have their limitations. So for example _Freund_ and _Freunde_ where stemmed to a different stems than _Freundin_ and _Freundinnen_.

---

<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: [December 4, 2019, 12:55pm UTC](https://discuss.elastic.co/t/german-stemmer-cistem-und-caumann-stemmer/210047/4 "2019-12-04T12:55:18Z")

</div>

stemmers for german languages are tricky in general. If those results are not good enough you could always resort to a dictionary based stemmer like the `hunspell` one.

We should update the documentation to update the `german_stem`. I'm happy to do that, unless you would be willing to submit a pull request.

--Alex

---

<div class="post-metadata">

### Author: ![htsr](https://avatars.discourse-cdn.com/v4/letter/h/bbce88/32.png) [@htsr](https://discuss.elastic.co/u/htsr)
#### Post date: [December 5, 2019, 5:09pm UTC](https://discuss.elastic.co/t/german-stemmer-cistem-und-caumann-stemmer/210047/5 "2019-12-05T17:09:15Z")

</div>

Hi, Alex,  
once again thanks for the information.

Another option could be mix stemming with synonyms for words known not to be stemmed appropriately. But that would be a somewhat static way to deal with this problem.

Could you please update the documentation.

---

<div class="post-metadata">

### Author: ![cbuescher](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/cbuescher/32/60402_2.png) [@cbuescher](https://discuss.elastic.co/u/cbuescher)
#### Post date: [December 6, 2019, 8:54am UTC](https://discuss.elastic.co/t/german-stemmer-cistem-und-caumann-stemmer/210047/6 "2019-12-06T08:54:47Z")

</div>

> [@htsr](#):
>
> mix stemming with synonyms for words known not to be stemmed

While this is a possible workaround, please note that there might be caveats in ranking synonyms slightly differently than stemmed tokens. For example, we currently explore ways to slightly [deboost matches on synonym tokens in search](https://github.com/elastic/elasticsearch/issues/49001). The same might be useful for stemmed vs. non-stemmed tokens, but those two things are semantically different and might be treated differently in scoring in the long run.

---

<div class="post-metadata">

### Author: ![cbuescher](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/cbuescher/32/60402_2.png) [@cbuescher](https://discuss.elastic.co/u/cbuescher)
#### Post date: [December 6, 2019, 8:59am UTC](https://discuss.elastic.co/t/german-stemmer-cistem-und-caumann-stemmer/210047/7 "2019-12-06T08:59:58Z")

</div>

> [@htsr](#):
>
> I tried the Cistem stemmer via a custom plugin...

btw. this sounds very interesting, which plugin did you use? Is it publicly available? Looks like the library is MIT licensed at least, which is great.

---

<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: [December 6, 2019, 12:04pm UTC](https://discuss.elastic.co/t/german-stemmer-cistem-und-caumann-stemmer/210047/8 "2019-12-06T12:04:19Z")

</div>

See [https://github.com/LeonieWeissweiler/CISTEM/blob/master/Cistem.java](https://github.com/LeonieWeissweiler/CISTEM/blob/master/Cistem.java) (not the plugin, just the java class), I hope that's what you meant?

---

<div class="post-metadata">

### Author: ![cbuescher](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/cbuescher/32/60402_2.png) [@cbuescher](https://discuss.elastic.co/u/cbuescher)
#### Post date: [December 6, 2019, 1:36pm UTC](https://discuss.elastic.co/t/german-stemmer-cistem-und-caumann-stemmer/210047/9 "2019-12-06T13:36:02Z")

</div>

Ah, okay. Sounded like there's a ready-to-install plugin already, but apparently not.

---

<div class="post-metadata">

### Author: ![htsr](https://avatars.discourse-cdn.com/v4/letter/h/bbce88/32.png) [@htsr](https://discuss.elastic.co/u/htsr)
#### Post date: [December 6, 2019, 2:31pm UTC](https://discuss.elastic.co/t/german-stemmer-cistem-und-caumann-stemmer/210047/10 "2019-12-06T14:31:01Z")

</div>

I wrote my own custom plugin using the stempel and ICU plugins as templates.

---

<div class="post-metadata">

### Author: ![cbuescher](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/cbuescher/32/60402_2.png) [@cbuescher](https://discuss.elastic.co/u/cbuescher)
#### Post date: [December 6, 2019, 4:17pm UTC](https://discuss.elastic.co/t/german-stemmer-cistem-und-caumann-stemmer/210047/11 "2019-12-06T16:17:49Z")

</div>

That sounds very interesting. I would be interested to try it if you want and are able to share, even if its in a WIP state, as long as I can build it from source. No problem if thats not possible though.

---

<div class="post-metadata">

### Author: ![htsr](https://avatars.discourse-cdn.com/v4/letter/h/bbce88/32.png) [@htsr](https://discuss.elastic.co/u/htsr)
#### Post date: [December 6, 2019, 5:50pm UTC](https://discuss.elastic.co/t/german-stemmer-cistem-und-caumann-stemmer/210047/12 "2019-12-06T17:50:37Z")

</div>

If you are interested in testing the plugin, I will try my best. But it will be next week that I will notify you.

---

<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: [January 3, 2020, 5:50pm UTC](https://discuss.elastic.co/t/german-stemmer-cistem-und-caumann-stemmer/210047/13 "2020-01-03T17:50:38Z")

</div>

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