# Language analyser

**URL:** <https://discuss.elastic.co/t/language-analyser/12708>\
**Category:** Elasticsearch\
**Created:** [July 9, 2013, 2:52am UTC](https://discuss.elastic.co/t/language-analyser/12708 "2013-07-09T02:52:09Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![oto\_iashvili](https://avatars.discourse-cdn.com/v4/letter/o/7ba0ec/32.png) [@oto\_iashvili](https://discuss.elastic.co/u/oto_iashvili)\
**Post date:** [July 9, 2013, 2:52am UTC](https://discuss.elastic.co/t/language-analyser/12708/1 "2013-07-09T02:52:09Z")

</div>

hi,

I'm using rails and tire and my site is in 5 languages. How can I specify a  
different analysis for each language?  
I think I will use Lang Analyzer English, french and russian, but the Lithuanian  
and Georgian, I do not know what to do, someone would have an idea?

thank you

--  
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:** ![Ivan](https://avatars.discourse-cdn.com/v4/letter/i/df788c/32.png) [@Ivan](https://discuss.elastic.co/u/Ivan)\
**Post date:** [July 9, 2013, 4:56pm UTC](https://discuss.elastic.co/t/language-analyser/12708/2 "2013-07-09T16:56:01Z")

</div>

Each field in the index can only be analyzed with one analyzer. If you want  
to support multiple languages, there are different approaches, each with  
its own pros and cons. The simplest way is to have a separate field for  
each language. Your indexing/searching code will need to contain logic  
about how to identify the proper field to use.

--  
Ivan

On Mon, Jul 8, 2013 at 7:52 PM, oto iashvili [optimum.dulopin@laposte.net](mailto:optimum.dulopin@laposte.net)wrote:

> hi,
> 
> I'm using rails and tire and my site is in 5 languages. How can I specify  
> a different analysis for each language?  
> I think I will use Lang Analyzer English, french and russian, but the Lithuanian  
> and Georgian, I do not know what to do, someone would have an idea?
> 
> thank you
> 
> --  
> 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).

--  
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:** ![oto\_iashvili](https://avatars.discourse-cdn.com/v4/letter/o/7ba0ec/32.png) [@oto\_iashvili](https://discuss.elastic.co/u/oto_iashvili)\
**Post date:** [July 10, 2013, 2:17am UTC](https://discuss.elastic.co/t/language-analyser/12708/3 "2013-07-10T02:17:11Z")

</div>

Hi thanks for answer.

That is exactly what im trying to but, but it seems it doesnt work, at  
least for stop word

here my mapping

{:id=\>{:type=\>"integer", :index=\>:not\_analyzed},  
:sousrubrique\_id=\>{:type=\>"integer", :index=\>:not\_analyzed},  
:ville\_id=\>{:type=\>"integer", :index=\>:not\_analyzed},  
:titre\_fr=\>{:analyzer=\>"french", :as=\>#\<Proc:0x00000008381078@(eval):1  
(lambda)\>, :type=\>"string"}, :texte\_fr=\>{:analyzer=\>"french",  
:as=\>#\<Proc:0x00000008380da8@(eval):2 (lambda)\>, :type=\>"string"},  
:titre\_ka=\>{:analyzer=\>"standard", :as=\>#\<Proc:0x000000085ba1a0@(eval):1  
(lambda)\>, :type=\>"string"}, :texte\_ka=\>{:analyzer=\>"standard",  
:as=\>#\<Proc:0x000000085b9f20@(eval):2 (lambda)\>, :type=\>"string"},  
:titre\_en=\>{:analyzer=\>"english", :as=\>#\<Proc:0x000000085fef80@(eval):1  
(lambda)\>, :type=\>"string"}, :texte\_en=\>{:analyzer=\>"english",  
:as=\>#\<Proc:0x000000085febe8@(eval):2 (lambda)\>, :type=\>"string"},  
:titre\_ru=\>{:analyzer=\>"russian", :as=\>#\<Proc:0x0000000840fa80@(eval):1  
(lambda)\>, :type=\>"string"}, :texte\_ru=\>{:analyzer=\>"russian",  
:as=\>#\<Proc:0x0000000840f210@(eval):2 (lambda)\>, :type=\>"string"},  
:titre\_lt=\>{:analyzer=\>"standard", :as=\>#\<Proc:0x00000008709790@(eval):1  
(lambda)\>, :type=\>"string"}, :texte\_lt=\>{:analyzer=\>"standard",  
:as=\>#\<Proc:0x00000006fba1c0@(eval):2 (lambda)\>, :type=\>"string"}

and here and example of request  
curl -X GET '  
[http://localhost:9200/georgieannonces/annonce/\_search?from=0&size=30&pretty](http://localhost:9200/georgieannonces/annonce/_search?from=0&size=30&pretty)'  
-d  
'{"query":{"filtered":{"query":{"query\_string":{"query":"aaaaaaaaaaaaaaaaaaaaaaa  
de","fields":["titre\_fr","texte\_fr"]}},"filter":{"and":[{"range":{"sousrubrique\_id":{"from":null,"to":85}}}]}}},"sort":[{"\_id":"desc"}],"highlight":{"fields":{"texte\_fr":{"fragment\_size":200},"titre\_fr":{"number\_of\_fragments":0}}},"size":30,"from":0}'

but this request give result with "de" that should not be as it is include  
in stop\_word and I dont understand why. Any idea ?

On Tuesday, July 9, 2013 6:56:01 PM UTC+2, Ivan Brusic wrote:

> Each field in the index can only be analyzed with one analyzer. If you  
> want to support multiple languages, there are different approaches, each  
> with its own pros and cons. The simplest way is to have a separate field  
> for each language. Your indexing/searching code will need to contain logic  
> about how to identify the proper field to use.
> 
> --  
> Ivan
> 
> On Mon, Jul 8, 2013 at 7:52 PM, oto iashvili \<[optimum...@laposte.net](mailto:optimum...@laposte.net)\<javascript:\>
> 
> > wrote:
> 
> > hi,
> > 
> > I'm using rails and tire and my site is in 5 languages. How can I specify  
> > a different analysis for each language?  
> > I think I will use Lang Analyzer English, french and russian, but the Lithuanian  
> > and Georgian, I do not know what to do, someone would have an idea?
> > 
> > thank you
> > 
> > --  
> > 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 [elasticsearc...@googlegroups.com](mailto:elasticsearc...@googlegroups.com) \<javascript:\>.  
> > For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

--  
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:27am UTC](https://discuss.elastic.co/t/language-analyser/12708/4 "2017-07-06T02:27:23Z")

</div>


