# How to query with multiple languages (field per language approach)

**URL:** <https://discuss.elastic.co/t/how-to-query-with-multiple-languages-field-per-language-approach/6979>\
**Category:** Elasticsearch\
**Created:** [March 13, 2012, 2:50pm UTC](https://discuss.elastic.co/t/how-to-query-with-multiple-languages-field-per-language-approach/6979 "2012-03-13T14:50:41Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Teemu\_Nuutinen](https://avatars.discourse-cdn.com/v4/letter/t/bbce88/32.png) [@Teemu\_Nuutinen](https://discuss.elastic.co/u/Teemu_Nuutinen)\
**Post date:** [March 13, 2012, 2:50pm UTC](https://discuss.elastic.co/t/how-to-query-with-multiple-languages-field-per-language-approach/6979/1 "2012-03-13T14:50:41Z")

</div>

Hi,

I have documents which have fields in a few different languages  
meaning that in one document field A might be English, field B German  
and in another document field A Finnish and field B English. The  
documents have other fields which should be searchable too (no  
language analysis). I would like to use language analyzers so the  
field per language approach should be the best option.

In short, I'm not experienced enough with elasticsearch and my  
problems are that:

1. I do not understand why tokens from language analyzed fields are  
not included in \_all and
2. why is there a strange conflict when using query\_string (Multi  
Field) to query the language analyzed fields together with \_all (see  
query 3 below)?

Using the following example mapping and record (full sh/json at  
[https://gist.github.com/2029161#file\_setup.sh](https://gist.github.com/2029161#file_setup.sh))...

Properties:

title:  
type: string,  
index: analyzed,  
boost: 2.0  
title\_eng:  
type: string,  
index: analyzed,  
analyzer: english  
title\_fin:  
type: string,  
index: analyzed,  
analyzer: finnish  
title\_ger:  
type: string,  
index: analyzed,  
analyzer: german

Record:

title: Topics on Vagueness,  
title\_eng: Topics on Vagueness

Tokens produced by english analyzer: topic, vagu

Then doing some searches (full sh/json: [https://gist.github.com/2029161#file\_queries.sh](https://gist.github.com/2029161#file_queries.sh)  
)...

- Query 1: No results, I guess languge specific tokens can't be found  
in \_all...

- Query 2: So now I have to query the language analyzed fields  
separately, record is found as expected

- Query 3: not found, what's going on?!

- Query 4: works as expected

Now, I guess there is no way I can or even should attempt to find  
stemmed versions in the \_all field? (Finding at least "topic" would be  
nice)

In that case given "one search box" the query options are either  
query\_string or dis\_max. But why doesn't query #3 work with title\_ger  
field? If I remove title\_ger field from the query or even replace it  
with a field that doesn't exist (foobar) the query works. If I query  
"topics vagueness" without "on" it works. Unlike english and finnish  
the german analyzer produces "on" token which seems to "break" the  
query, but there is no data in that field! I don't get it.

So is query #4 (dis\_max) the way to go or will I run into problems  
later?

Wow, that turned out to be long, thanks for reading!

---

<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, 3:36am UTC](https://discuss.elastic.co/t/how-to-query-with-multiple-languages-field-per-language-approach/6979/2 "2017-07-06T03:36:19Z")

</div>


