# Using a different analyzer for each query and same index

**URL:** <https://discuss.elastic.co/t/using-a-different-analyzer-for-each-query-and-same-index/20141>\
**Category:** Elasticsearch\
**Created:** [October 8, 2014, 2:16pm UTC](https://discuss.elastic.co/t/using-a-different-analyzer-for-each-query-and-same-index/20141 "2014-10-08T14:16:42Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Aris\_Alexis](https://avatars.discourse-cdn.com/v4/letter/a/76d3ee/32.png) [@Aris\_Alexis](https://discuss.elastic.co/u/Aris_Alexis)\
**Post date:** [October 8, 2014, 2:16pm UTC](https://discuss.elastic.co/t/using-a-different-analyzer-for-each-query-and-same-index/20141/1 "2014-10-08T14:16:42Z")

</div>

Hi,

first of all I am a noob with elastic so bear with me.

I am interested to know if this scenario is possible:

A user posts some text , my app detects the language and index the text  
with the spanish analyzer for example.  
B user posts some text in english, my app detects it and indexex the text  
with the english analyzer _in the same field_.

The search query also specifies the analyzer.

Is this possible or do I need a field for every language? that's not a very  
elegant solution.

some other idea?

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).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/bdb5c51d-be3e-4155-bffe-3b6227e99a98%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/bdb5c51d-be3e-4155-bffe-3b6227e99a98%40googlegroups.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<div class="post-metadata">

**Author:** ![Aris\_Alexis](https://avatars.discourse-cdn.com/v4/letter/a/76d3ee/32.png) [@Aris\_Alexis](https://discuss.elastic.co/u/Aris_Alexis)\
**Post date:** [October 11, 2014, 3:39pm UTC](https://discuss.elastic.co/t/using-a-different-analyzer-for-each-query-and-same-index/20141/2 "2014-10-11T15:39:40Z")

</div>

bump

On Wednesday, October 8, 2014 4:16:42 PM UTC+2, Aris Alexis wrote:

> Hi,
> 
> first of all I am a noob with elastic so bear with me.
> 
> I am interested to know if this scenario is possible:
> 
> A user posts some text , my app detects the language and index the text  
> with the spanish analyzer for example.  
> B user posts some text in english, my app detects it and indexex the text  
> with the english analyzer _in the same field_.
> 
> The search query also specifies the analyzer.
> 
> Is this possible or do I need a field for every language? that's not a  
> very elegant solution.
> 
> some other idea?
> 
> 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).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/080acb42-a86c-4072-a0ee-f42ee44eef4a%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/080acb42-a86c-4072-a0ee-f42ee44eef4a%40googlegroups.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<div class="post-metadata">

**Author:** ![johtani](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/johtani/32/44956_2.png) [@johtani](https://discuss.elastic.co/u/johtani)\
**Post date:** [October 14, 2014, 7:00am UTC](https://discuss.elastic.co/t/using-a-different-analyzer-for-each-query-and-same-index/20141/3 "2014-10-14T07:00:33Z")

</div>

Hi,

I think this page is useful for you.

> **[Elastic — The Search AI Company](https://www.elastic.co)**
>
> Power insights and outcomes with The Elastic Search AI Platform. See into your data and find answers that matter with enterprise solutions designed to help you accelerate time to insight. Try Elastic ...

2014-10-12 0:39 GMT+09:00 Aris Alexis [snowboard789@gmail.com](mailto:snowboard789@gmail.com):

> bump
> 
> On Wednesday, October 8, 2014 4:16:42 PM UTC+2, Aris Alexis wrote:
> 
> > Hi,
> > 
> > first of all I am a noob with elastic so bear with me.
> > 
> > I am interested to know if this scenario is possible:
> > 
> > A user posts some text , my app detects the language and index the text  
> > with the spanish analyzer for example.  
> > B user posts some text in english, my app detects it and indexex the text  
> > with the english analyzer _in the same field_.
> > 
> > The search query also specifies the analyzer.
> > 
> > Is this possible or do I need a field for every language? that's not a  
> > very elegant solution.
> > 
> > some other idea?
> > 
> > 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).  
> > To view this discussion on the web visit  
> > [https://groups.google.com/d/msgid/elasticsearch/080acb42-a86c-4072-a0ee-f42ee44eef4a%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/080acb42-a86c-4072-a0ee-f42ee44eef4a%40googlegroups.com)  
> > [https://groups.google.com/d/msgid/elasticsearch/080acb42-a86c-4072-a0ee-f42ee44eef4a%40googlegroups.com?utm\_medium=email&utm\_source=footer](https://groups.google.com/d/msgid/elasticsearch/080acb42-a86c-4072-a0ee-f42ee44eef4a%40googlegroups.com?utm_medium=email&utm_source=footer)  
> > .
> 
> For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

## --

Jun Ohtani  
blog : [http://blog.johtani.info](http://blog.johtani.info)

--  
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/CAPW8A5yZJJFGtvD8\_HEQ5PmScd\_701gne-A%2BcwHnenc21t1Ofg%40mail.gmail.com](https://groups.google.com/d/msgid/elasticsearch/CAPW8A5yZJJFGtvD8_HEQ5PmScd_701gne-A%2BcwHnenc21t1Ofg%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, 12:56am UTC](https://discuss.elastic.co/t/using-a-different-analyzer-for-each-query-and-same-index/20141/4 "2017-07-06T00:56:27Z")

</div>


