# How to increase relevance of compound words when using dictionary\_decompounder filter

**URL:** <https://discuss.elastic.co/t/how-to-increase-relevance-of-compound-words-when-using-dictionary-decompounder-filter/40564>\
**Category:** Elasticsearch\
**Created:** [January 30, 2016, 6:08pm UTC](https://discuss.elastic.co/t/how-to-increase-relevance-of-compound-words-when-using-dictionary-decompounder-filter/40564 "2016-01-30T18:08:46Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![psilos](https://avatars.discourse-cdn.com/v4/letter/p/c0e974/32.png) [@psilos](https://discuss.elastic.co/u/psilos)\
**Post date:** [January 30, 2016, 6:08pm UTC](https://discuss.elastic.co/t/how-to-increase-relevance-of-compound-words-when-using-dictionary-decompounder-filter/40564/1 "2016-01-30T18:08:46Z")

</div>

Hi guys,

I have an index with a bunch of products. Among them there are "...smart watch phone..." and "smartphone" products. I used a dictionary\_decompounder filter so that even when I search for "smart phone", products with "smartphone" will come up.

However still the products with "...smart watch phone..." description appear first in the list. What i need is to get first the products with "...smartphone..." description.

Is there a way to configure the decompounded words so that they have the highest relevance?

Thank you

---

<div class="post-metadata">

**Author:** ![softwaredoug](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/softwaredoug/32/22681_2.png) [@softwaredoug](https://discuss.elastic.co/u/softwaredoug)\
**Post date:** [January 30, 2016, 8:19pm UTC](https://discuss.elastic.co/t/how-to-increase-relevance-of-compound-words-when-using-dictionary-decompounder-filter/40564/2 "2016-01-30T20:19:47Z")

</div>

The problem with decompounding, is it places all the tokens in the same position `smartphone` `smart` and `phone` seem to represent identical concepts.

Synonyms, on the other hand, can break apart `smartphone` into `smart` with `phone,` treating them as adjacent position. For example, try the following filter instead of decompounding

```json
"synonym" : {
       "type" : "synonym",
       "synonyms" : [
             "smartphone => smart phone"
       ],
       "preserve_original" : true
}

```

This lets you then add a phrase query boost like

```json
{
   "query": {
       "bool": {
           "should": [
             {"match_phrase": {
                "text": "smart phone"}},
            {"match": {
                "text": "smart phone"}}
            ]
       }
    }
}

```

to get closer to your expected behavior

---

<div class="post-metadata">

**Author:** ![psilos](https://avatars.discourse-cdn.com/v4/letter/p/c0e974/32.png) [@psilos](https://discuss.elastic.co/u/psilos)\
**Post date:** [January 31, 2016, 8:51pm UTC](https://discuss.elastic.co/t/how-to-increase-relevance-of-compound-words-when-using-dictionary-decompounder-filter/40564/3 "2016-01-31T20:51:18Z")

</div>

Thnx a lot.

Indeed I now get better results!!

---

<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 5, 2017, 11:20pm UTC](https://discuss.elastic.co/t/how-to-increase-relevance-of-compound-words-when-using-dictionary-decompounder-filter/40564/4 "2017-07-05T23:20:03Z")

</div>


