# Hyphenation\_decompounder tokens do not consider "Operator" in multi-match query

**URL:** https://discuss.elastic.co/t/hyphenation-decompounder-tokens-do-not-consider-operator-in-multi-match-query/261102
**Category:** Elasticsearch
**Created:** [January 14, 2021, 10:10am UTC](https://discuss.elastic.co/t/hyphenation-decompounder-tokens-do-not-consider-operator-in-multi-match-query/261102 "2021-01-14T10:10:49Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![wn1099](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/wn1099/32/82228_2.png) [@wn1099](https://discuss.elastic.co/u/wn1099)
#### Post date: [January 14, 2021, 10:10am UTC](https://discuss.elastic.co/t/hyphenation-decompounder-tokens-do-not-consider-operator-in-multi-match-query/261102/1 "2021-01-14T10:10:49Z")

</div>

Hi,

I used `hyphenation_decompounder`([https://www.elastic.co/guide/en/elasticsearch/reference/current/analysis-hyp-decomp-tokenfilter.html](https://www.elastic.co/guide/en/elasticsearch/reference/current/analysis-hyp-decomp-tokenfilter.html)) for German language and followed the example as mentioned in the documentation. So far so good. it works!. The text `kaffeetasse` is tokenised into `kaffee` and `tasse`.

The concern arose when I built " **multi-match**" query `kaffeetasse` to find documents where `kaffee` **AND** `tasse` both matches. It seems that multi-match uses **OR** for these tokens instead of given `Operator` in multi-match query. Here is my Test-case

```auto
curl -XPUT "http://localhost:9200/testidx" -H 'Content-Type: application/json' -d'{ "settings": { "index": { "analysis": { "analyzer": { "index": { "type" : "custom", "tokenizer": "whitespace", "filter": ["lowercase"] }, "search": { "type" : "custom", "tokenizer": "whitespace", "filter": ["lowercase", "hyph"] } }, "filter": { "hyph": { "type": "hyphenation_decompounder", "hyphenation_patterns_path": "analysis/de_DR.xml", "word_list": ["kaffee", "zucker", "tasse"], "only_longest_match": true, "min_subword_size": 4 } } } } }, "mappings" : { "properties" : { "title" : { "type" : "text", "analyzer": "index", "search_analyzer": "search" }, "description" : { "type" : "text", "analyzer": "index", "search_analyzer": "search" } } } }' 

```

```auto
curl -XPOST "http://localhost:9200/testidx/_doc/1" -H 'Content-Type: application/json' -d'{ "title" : "Kaffee", "description": "Milch Kaffee tasse"}' 

```

```auto
curl -XPOST "http://localhost:9200/testidx/_doc/2" -H 'Content-Type: application/json' -d'{ "title" : "Kaffee", "description": "Latte Kaffee Becher"}' 

```

```auto
curl -XGET "http://localhost:9200/testidx/_search" -H 'Content-Type: application/json' -d'{ "query": { "multi_match": { "query": "kaffeetasse", "fields": ["title", "description"], "operator": "and", "type": "cross_fields", "analyzer": "search" } }}'

```

I expected only document **id=1** as it has "kaffee" and "tasse" in their fields but query returns both documents as they contains terms "kaffee" or "tasse" .

At first glance, it seems a bug to me. Any thoughts about that ?

Elasticsearch: 7.9.2  
`de_DR.xml` downloaded from [https://sourceforge.net/projects/offo/files/offo-hyphenation/1.2/offo-hyphenation\_v1.2.zip/download](https://sourceforge.net/projects/offo/files/offo-hyphenation/1.2/offo-hyphenation_v1.2.zip/download) as mentioned in the documentation.

* * *

For non-german speakers  
kaffeetasse =\> coffee cup

---

<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: [February 11, 2021, 10:11am UTC](https://discuss.elastic.co/t/hyphenation-decompounder-tokens-do-not-consider-operator-in-multi-match-query/261102/2 "2021-02-11T10:11:03Z")

</div>

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