# Mult-language searchable in one field

**URL:** <https://discuss.elastic.co/t/mult-language-searchable-in-one-field/17427>\
**Category:** Elasticsearch\
**Created:** [May 9, 2014, 10:40am UTC](https://discuss.elastic.co/t/mult-language-searchable-in-one-field/17427 "2014-05-09T10:40:44Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![Martin\_3](https://avatars.discourse-cdn.com/v4/letter/m/c67d28/32.png) [@Martin\_3](https://discuss.elastic.co/u/Martin_3)\
**Post date:** [May 9, 2014, 10:40am UTC](https://discuss.elastic.co/t/mult-language-searchable-in-one-field/17427/1 "2014-05-09T10:40:44Z")

</div>

Hi,

I've got descriptions in different languages with different analyzers like  
this:

description\_lang: {

- properties: {
  - de: {
    - analyzer: my\_analyzer\_de
    - type: string  
}

  - en: {
    - analyzer: my\_analyzer\_en
    - type: string  
}  
}

}

They are searchabel with "description\_lang.de" and "description\_lang.en"but I'd like to search them all together with only  
"  
description\_lang" is that possible somehow ?

Thank you very much,  
Martin

--  
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).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/b1edecec-4722-4e3f-b82c-eb742d7cb3ad%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/b1edecec-4722-4e3f-b82c-eb742d7cb3ad%40googlegroups.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<div class="post-metadata">

**Author:** ![Martin\_3](https://avatars.discourse-cdn.com/v4/letter/m/c67d28/32.png) [@Martin\_3](https://discuss.elastic.co/u/Martin_3)\
**Post date:** [May 9, 2014, 10:45am UTC](https://discuss.elastic.co/t/mult-language-searchable-in-one-field/17427/2 "2014-05-09T10:45:13Z")

</div>

and I cant' use the "\_all" field because of own scoring.

--  
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).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/5d87fc34-f433-4b2f-83b9-7a0118b1ab8d%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/5d87fc34-f433-4b2f-83b9-7a0118b1ab8d%40googlegroups.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<div class="post-metadata">

**Author:** ![Itamar\_Syn\_Hershko](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/itamar_syn_hershko/32/725_2.png) [@Itamar\_Syn\_Hershko](https://discuss.elastic.co/u/Itamar_Syn_Hershko)\
**Post date:** [May 9, 2014, 10:45am UTC](https://discuss.elastic.co/t/mult-language-searchable-in-one-field/17427/3 "2014-05-09T10:45:17Z")

</div>

And then what analyzer you will use for that?

It is doable, but I'd strongly suggest against it unless you know what you  
are doing:

> **[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.

--

Itamar Syn-Hershko  
[http://code972.com](http://code972.com) | @synhershko [https://twitter.com/synhershko](https://twitter.com/synhershko)  
Freelance Developer & Consultant  
Author of RavenDB in Action [http://manning.com/synhershko/](http://manning.com/synhershko/)

On Fri, May 9, 2014 at 1:40 PM, Martin [martin.konradi@echtzeiten.com](mailto:martin.konradi@echtzeiten.com)wrote:

> Hi,
> 
> I've got descriptions in different languages with different analyzers like  
> this:
> 
> description\_lang: {
> 
> - properties: {
> - de: {
> - analyzer: my\_analyzer\_de
> - type: string  
> }
> 
> - en: {
> - analyzer: my\_analyzer\_en
> - type: string  
> }  
> }
> 
> }
> 
> They are searchabel with "description\_lang.de" and "description\_lang.en"but I'd like to search them all together with only  
> "  
> description\_lang" is that possible somehow ?
> 
> Thank you very much,  
> Martin
> 
> --  
> 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).  
> To view this discussion on the web visit  
> [https://groups.google.com/d/msgid/elasticsearch/b1edecec-4722-4e3f-b82c-eb742d7cb3ad%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/b1edecec-4722-4e3f-b82c-eb742d7cb3ad%40googlegroups.com)[https://groups.google.com/d/msgid/elasticsearch/b1edecec-4722-4e3f-b82c-eb742d7cb3ad%40googlegroups.com?utm\_medium=email&utm\_source=footer](https://groups.google.com/d/msgid/elasticsearch/b1edecec-4722-4e3f-b82c-eb742d7cb3ad%40googlegroups.com?utm_medium=email&utm_source=footer)  
> .  
> For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

--  
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).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/CAHTr4ZtryLtndSjLdZu8dnmARMpsZhzxHc1y18XFKxUtv\_DzYQ%40mail.gmail.com](https://groups.google.com/d/msgid/elasticsearch/CAHTr4ZtryLtndSjLdZu8dnmARMpsZhzxHc1y18XFKxUtv_DzYQ%40mail.gmail.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<div class="post-metadata">

**Author:** ![Martin\_3](https://avatars.discourse-cdn.com/v4/letter/m/c67d28/32.png) [@Martin\_3](https://discuss.elastic.co/u/Martin_3)\
**Post date:** [May 9, 2014, 12:46pm UTC](https://discuss.elastic.co/t/mult-language-searchable-in-one-field/17427/4 "2014-05-09T12:46:59Z")

</div>

Thank you - I thought may be there is another type like object-type which  
would provide it.  
Actually it should be a type like the array-type but with fields you could  
analyse separately.  
There would be different analysers for each language (especially because of  
stemming).

--  
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).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/a8aa260b-a91b-4300-877a-c69928bdcfc8%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/a8aa260b-a91b-4300-877a-c69928bdcfc8%40googlegroups.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<div class="post-metadata">

**Author:** ![Itamar\_Syn\_Hershko](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/itamar_syn_hershko/32/725_2.png) [@Itamar\_Syn\_Hershko](https://discuss.elastic.co/u/Itamar_Syn_Hershko)\
**Post date:** [May 9, 2014, 12:52pm UTC](https://discuss.elastic.co/t/mult-language-searchable-in-one-field/17427/5 "2014-05-09T12:52:38Z")

</div>

You can do that, but by generating the query on the client side. I'd then  
use a Boolean query wrapping a Match query, each on a different language  
field and specifying the analyzer explicitly.

I think that's a healthier approach as it's easily changable and easier to  
debug, as often times multi-lingual search demands a lot of attention

Not long ago I gave a talk about this topic, you might find it helpful:

> **[Approaches to multi-lingual text search with Elasticsearch and Lucene |...](https://skillsmatter.com/skillscasts/4968-approaches-to-multi-lingual-text-search-with-elasticsearch-and-lucene)**
>
> Skills Matter In The Brain community cast. Itamar Syn-Hershko: Interested in the design and development of applications that provide multi-lingual text searc...

--

Itamar Syn-Hershko  
[http://code972.com](http://code972.com) | @synhershko [https://twitter.com/synhershko](https://twitter.com/synhershko)  
Freelance Developer & Consultant  
Author of RavenDB in Action [http://manning.com/synhershko/](http://manning.com/synhershko/)

On Fri, May 9, 2014 at 3:46 PM, Martin [martin.konradi@echtzeiten.com](mailto:martin.konradi@echtzeiten.com)wrote:

> Thank you - I thought may be there is another type like object-type which  
> would provide it.  
> Actually it should be a type like the array-type but with fields you could  
> analyse separately.  
> There would be different analysers for each language (especially because  
> of stemming).
> 
> --  
> 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).  
> To view this discussion on the web visit  
> [https://groups.google.com/d/msgid/elasticsearch/a8aa260b-a91b-4300-877a-c69928bdcfc8%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/a8aa260b-a91b-4300-877a-c69928bdcfc8%40googlegroups.com)[https://groups.google.com/d/msgid/elasticsearch/a8aa260b-a91b-4300-877a-c69928bdcfc8%40googlegroups.com?utm\_medium=email&utm\_source=footer](https://groups.google.com/d/msgid/elasticsearch/a8aa260b-a91b-4300-877a-c69928bdcfc8%40googlegroups.com?utm_medium=email&utm_source=footer)  
> .
> 
> For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

--  
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).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/CAHTr4ZtaEHYq8ELY-A0mTnLRkvCk76GXT7KeDqQfYva8by4K8g%40mail.gmail.com](https://groups.google.com/d/msgid/elasticsearch/CAHTr4ZtaEHYq8ELY-A0mTnLRkvCk76GXT7KeDqQfYva8by4K8g%40mail.gmail.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<div class="post-metadata">

**Author:** ![Martin\_3](https://avatars.discourse-cdn.com/v4/letter/m/c67d28/32.png) [@Martin\_3](https://discuss.elastic.co/u/Martin_3)\
**Post date:** [May 9, 2014, 1:08pm UTC](https://discuss.elastic.co/t/mult-language-searchable-in-one-field/17427/6 "2014-05-09T13:08:42Z")

</div>

OK - I thought I could leave all my queries and add an additional filter if  
the item is available in that language.  
I'll watch your talk!

--  
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).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/fcd4b3b2-a254-4f0d-9f44-f4174e303a24%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/fcd4b3b2-a254-4f0d-9f44-f4174e303a24%40googlegroups.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<div class="post-metadata">

**Author:** ![jprante](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jprante/32/44941_2.png) [@jprante](https://discuss.elastic.co/u/jprante)\
**Post date:** [May 9, 2014, 1:15pm UTC](https://discuss.elastic.co/t/mult-language-searchable-in-one-field/17427/7 "2014-05-09T13:15:17Z")

</div>

You can index two fields into a third common field with "index\_name" in  
combination with "multi\_field". This works like a custom "\_all" field.

Jörg

On Fri, May 9, 2014 at 3:08 PM, Martin [martin.konradi@echtzeiten.com](mailto:martin.konradi@echtzeiten.com)wrote:

> OK - I thought I could leave all my queries and add an additional filter  
> if the item is available in that language.  
> I'll watch your talk!
> 
> --  
> 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).  
> To view this discussion on the web visit  
> [https://groups.google.com/d/msgid/elasticsearch/fcd4b3b2-a254-4f0d-9f44-f4174e303a24%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/fcd4b3b2-a254-4f0d-9f44-f4174e303a24%40googlegroups.com)[https://groups.google.com/d/msgid/elasticsearch/fcd4b3b2-a254-4f0d-9f44-f4174e303a24%40googlegroups.com?utm\_medium=email&utm\_source=footer](https://groups.google.com/d/msgid/elasticsearch/fcd4b3b2-a254-4f0d-9f44-f4174e303a24%40googlegroups.com?utm_medium=email&utm_source=footer)  
> .
> 
> For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

--  
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).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/CAKdsXoEC018Hmf%3DjXhTOoYtX5WE8255hwWcLjb1QtmbnWr-twQ%40mail.gmail.com](https://groups.google.com/d/msgid/elasticsearch/CAKdsXoEC018Hmf%3DjXhTOoYtX5WE8255hwWcLjb1QtmbnWr-twQ%40mail.gmail.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<div class="post-metadata">

**Author:** ![Martin\_3](https://avatars.discourse-cdn.com/v4/letter/m/c67d28/32.png) [@Martin\_3](https://discuss.elastic.co/u/Martin_3)\
**Post date:** [May 9, 2014, 2:19pm UTC](https://discuss.elastic.co/t/mult-language-searchable-in-one-field/17427/8 "2014-05-09T14:19:25Z")

</div>

ah wow - that's cool. I just came across your  
[http://jprante.github.io/lessons/2012/05/11/ISBN-search-with-Elasticsearch.html](http://jprante.github.io/lessons/2012/05/11/ISBN-search-with-Elasticsearch.html)  
which explains it in detail.  
That's pretty close to what I want but I just found a new problem: There  
should be a highlighting of the found results - so I guess I'll have to go  
with multiple boolean should queries.

--  
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).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/7d18189b-9950-4020-bf3d-dd26680cfa46%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/7d18189b-9950-4020-bf3d-dd26680cfa46%40googlegroups.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<div class="post-metadata">

**Author:** ![jprante](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jprante/32/44941_2.png) [@jprante](https://discuss.elastic.co/u/jprante)\
**Post date:** [May 9, 2014, 9:31pm UTC](https://discuss.elastic.co/t/mult-language-searchable-in-one-field/17427/9 "2014-05-09T21:31:06Z")

</div>

Elasticsearch has improved ithe "index\_name" with the "copy\_to" mechanism.

I have set up a gist to demonstrate multilingual highlighting, maybe it is  
useful.

> <https://gist.github.com/jprante/9f7523bb59ea654a3931>

Jörg

On Fri, May 9, 2014 at 4:19 PM, Martin [martin.konradi@echtzeiten.com](mailto:martin.konradi@echtzeiten.com)wrote:

> ah wow - that's cool. I just came across your  
> [http://jprante.github.io/lessons/2012/05/11/ISBN-search-with-Elasticsearch.htmlwhich](http://jprante.github.io/lessons/2012/05/11/ISBN-search-with-Elasticsearch.htmlwhich) explains it in detail.  
> That's pretty close to what I want but I just found a new problem: There  
> should be a highlighting of the found results - so I guess I'll have to go  
> with multiple boolean should queries.
> 
> --  
> 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).  
> To view this discussion on the web visit  
> [https://groups.google.com/d/msgid/elasticsearch/7d18189b-9950-4020-bf3d-dd26680cfa46%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/7d18189b-9950-4020-bf3d-dd26680cfa46%40googlegroups.com)[https://groups.google.com/d/msgid/elasticsearch/7d18189b-9950-4020-bf3d-dd26680cfa46%40googlegroups.com?utm\_medium=email&utm\_source=footer](https://groups.google.com/d/msgid/elasticsearch/7d18189b-9950-4020-bf3d-dd26680cfa46%40googlegroups.com?utm_medium=email&utm_source=footer)  
> .
> 
> For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

--  
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).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/CAKdsXoHEzVWVJBkjOV2sLoWczdo2jSvaftmN7yFL4Xvjk7wN4w%40mail.gmail.com](https://groups.google.com/d/msgid/elasticsearch/CAKdsXoHEzVWVJBkjOV2sLoWczdo2jSvaftmN7yFL4Xvjk7wN4w%40mail.gmail.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<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, 1:30am UTC](https://discuss.elastic.co/t/mult-language-searchable-in-one-field/17427/10 "2017-07-06T01:30:26Z")

</div>


