# Matching combined words in elasticsearch?

**URL:** <https://discuss.elastic.co/t/matching-combined-words-in-elasticsearch/240284>\
**Category:** Elasticsearch\
**Created:** [July 8, 2020, 7:32am UTC](https://discuss.elastic.co/t/matching-combined-words-in-elasticsearch/240284 "2020-07-08T07:32:54Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![jnatten](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jnatten/32/71781_2.png) [@jnatten](https://discuss.elastic.co/u/jnatten)\
**Post date:** [July 8, 2020, 7:32am UTC](https://discuss.elastic.co/t/matching-combined-words-in-elasticsearch/240284/1 "2020-07-08T07:32:54Z")

</div>

Hi,

We're using Elasticsearch for providing content search for users on our website, and I have a question regarding combined/compound words.

In our language (Norwegian) "combined words" are a very regular occurrence, and it is typical to make the mistake of writing the words separated rather than combined (Pretty much the opposite of English. Ex: A common mistake is writing 'hoste saft' instead of 'hostesaft').

And we would like to account for this when users are searching for `hoste saft` (two words) and return hits for `hostesaft` (as well as `hoste saft`, I guess).

I found the [compound word tokenfilter](https://www.elastic.co/guide/en/elasticsearch/reference/6.8/analysis-compound-word-tokenfilter.html) in the docs, but I'm not sure if this is what I want (Also it is pretty infeasible to provide a word list for every word that would match as there are a lot).

**Is the best approach to simply check for whitespace in the querystring and add a second query (without whitespace) to our should clause to account for this?**  
That is our current solution and it works, but I would assume that it increases the cost of the query somewhat (2x?).

All help is appreciated 😄

---

<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:** [August 5, 2020, 7:32am UTC](https://discuss.elastic.co/t/matching-combined-words-in-elasticsearch/240284/2 "2020-08-05T07:32:56Z")

</div>

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