# Hyphenation decompounder token filter seems to ignore the \`only\_longest\_match\` option

**URL:** https://discuss.elastic.co/t/hyphenation-decompounder-token-filter-seems-to-ignore-the-only-longest-match-option/294047
**Category:** Elasticsearch
**Created:** [January 11, 2022, 2:31pm UTC](https://discuss.elastic.co/t/hyphenation-decompounder-token-filter-seems-to-ignore-the-only-longest-match-option/294047 "2022-01-11T14:31:23Z")
**Posts on this page:** 1
**Showing post:** 2

<div class="post-metadata">

### Author: ![Tomo\_M](https://avatars.discourse-cdn.com/v4/letter/t/848f3c/32.png) [@Tomo\_M](https://discuss.elastic.co/u/Tomo_M)
#### Post date: [January 11, 2022, 3:26pm UTC](https://discuss.elastic.co/t/hyphenation-decompounder-token-filter-seems-to-ignore-the-only-longest-match-option/294047/2 "2022-01-11T15:26:18Z")

</div>

Hi,

I found a relevant discussion. Unfortunately, it seems a known Lucene behaviour. If so, the name 'only\_longest\_match' is a bit confusing but consistent with Lucene onlyLongedtMatch flag.

> [@Compound word token filter: only\_longest\_match doesn't work as expected in some scenarios](https://discuss.elastic.co/t/compound-word-token-filter-only-longest-match-doesnt-work-as-expected-in-some-scenarios/195470/2):
>
> The only\_longest\_match option may not quite work how you think it does. [This Lucene issue comment](https://issues.apache.org/jira/browse/LUCENE-8183?focusedCommentId=16374886&page=com.atlassian.jira.plugin.system.issuetabpanels%3Acomment-tabpanel#comment-16374886) has details on how it works: The onlyLongestMatch flag currently affects whether all matches or only the longest match should be returned per start character (in DictionaryCompoundWordTokenFilter) or per hyphenation start point (in HyphenationCompoundWordTokenFilter). Example: Dictionary "Schaft", "Wirt", "Wirtschaft", "Wissen", "Wissenschaft" for input "Wirtschaftswissenschaft" will retu…

---

_[View the full topic](https://discuss.elastic.co/t/hyphenation-decompounder-token-filter-seems-to-ignore-the-only-longest-match-option/294047)._
