# Best practices to match subwords in foreign languages

**URL:** <https://discuss.elastic.co/t/best-practices-to-match-subwords-in-foreign-languages/11238>\
**Category:** Elasticsearch\
**Created:** [March 21, 2013, 1:12pm UTC](https://discuss.elastic.co/t/best-practices-to-match-subwords-in-foreign-languages/11238 "2013-03-21T13:12:10Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Arny\_2](https://avatars.discourse-cdn.com/v4/letter/a/e56c9b/32.png) [@Arny\_2](https://discuss.elastic.co/u/Arny_2)\
**Post date:** [March 21, 2013, 1:12pm UTC](https://discuss.elastic.co/t/best-practices-to-match-subwords-in-foreign-languages/11238/1 "2013-03-21T13:12:10Z")

</div>

Hi,

I'm having some difficulties to match words which are inside larger words.  
E.g. Elasticsearch: If I search for "search" it should match  
"Elasticsearch".  
In German we have a lot such words, like: Seidenchiffonbluse.  
Now I want to match all words with "bluse".

Now I have read a lot of examples about partial word matching using ngram,  
but to me this seems not the right way to go.  
I don't want to match "blu", "blus" or anything the like.  
Best way would be to provide a real dictionary of words and let  
Elasticsearch strip it into words/tokens.

Are there any pre-defined language settings or dictionaries inside ES?  
We store many language dependent texts inside one document which look like  
this:  
document : { EN : { title : "english title" }, DE : { title : "german  
title" }, ....}

Would appreciate any help.

Thanks

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<div class="post-metadata">

**Author:** ![Clinton\_Gormley](https://avatars.discourse-cdn.com/v4/letter/c/50afbb/32.png) [@Clinton\_Gormley](https://discuss.elastic.co/u/Clinton_Gormley)\
**Post date:** [March 21, 2013, 3:53pm UTC](https://discuss.elastic.co/t/best-practices-to-match-subwords-in-foreign-languages/11238/2 "2013-03-21T15:53:04Z")

</div>

> Now I have read a lot of examples about partial word matching using  
> ngram, but to me this seems not the right way to go.  
> I don't want to match "blu", "blus" or anything the like.  
> Best way would be to provide a real dictionary of words and let  
> Elasticsearch strip it into words/tokens.

You're looking for the compound word token filter:

> **[Elasticsearch Platform — Find real-time answers at scale](https://www.elastic.co)**
>
> Power insights and outcomes with the Elasticsearch Platform and AI. See into your data and find answers that matter with enterprise solutions designed to help you build, observe, and protect. Try Elasticsearch free today.

clint

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<div class="post-metadata">

**Author:** ![Arny\_2](https://avatars.discourse-cdn.com/v4/letter/a/e56c9b/32.png) [@Arny\_2](https://discuss.elastic.co/u/Arny_2)\
**Post date:** [March 21, 2013, 5:05pm UTC](https://discuss.elastic.co/t/best-practices-to-match-subwords-in-foreign-languages/11238/3 "2013-03-21T17:05:50Z")

</div>

this looks good.

Thanks

Am Donnerstag, 21. März 2013 16:53:04 UTC+1 schrieb Clinton Gormley:

> > Now I have read a lot of examples about partial word matching using  
> > ngram, but to me this seems not the right way to go.  
> > I don't want to match "blu", "blus" or anything the like.  
> > Best way would be to provide a real dictionary of words and let  
> > Elasticsearch strip it into words/tokens.
> 
> You're looking for the compound word token filter:
> 
> [http://www.elasticsearch.org/guide/reference/index-modules/analysis/compound-word-tokenfilter.html](http://www.elasticsearch.org/guide/reference/index-modules/analysis/compound-word-tokenfilter.html)
> 
> clint

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<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 6, 2017, 2:45am UTC](https://discuss.elastic.co/t/best-practices-to-match-subwords-in-foreign-languages/11238/4 "2017-07-06T02:45:16Z")

</div>


