# Combining Analyzer/Tokenizer in one

**URL:** <https://discuss.elastic.co/t/combining-analyzer-tokenizer-in-one/12926>\
**Category:** Elasticsearch\
**Created:** [July 25, 2013, 1:24am UTC](https://discuss.elastic.co/t/combining-analyzer-tokenizer-in-one/12926 "2013-07-25T01:24:31Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Pablo\_Molnar](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/pablo_molnar/32/2200_2.png) [@Pablo\_Molnar](https://discuss.elastic.co/u/Pablo_Molnar)\
**Post date:** [July 25, 2013, 1:24am UTC](https://discuss.elastic.co/t/combining-analyzer-tokenizer-in-one/12926/1 "2013-07-25T01:24:31Z")

</div>

Hello fellas,

It is possible to have an analyzer that the result is the combination of  
other two analyzers ("keyword" and "standard" in my case)

e.g.: Given "_twenty-eight-year-old_"

/\_analyze?text=twenty-eight-year-old&analyzer=standard\* \*returns [twenty,  
eight, year, old]  
/\_analyze?text=twenty-eight-year-old&analyzer=keyword returns [  
twenty-eight-year-old]

My goal is having a single analyzer that returns [twenty-eight-year-old, twenty,eight,  
year, old]

Thanks,  
Pablo

--  
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:** ![dadoonet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dadoonet/32/137187_2.png) [@dadoonet](https://discuss.elastic.co/u/dadoonet)\
**Post date:** [July 25, 2013, 2:57am UTC](https://discuss.elastic.co/t/combining-analyzer-tokenizer-in-one/12926/2 "2013-07-25T02:57:07Z")

</div>

Not exactly the answer you may expect but you could use multifield to set both analyzers to the same field and then search in both _subfields_...

Does it help?

--  
David 😉  
Twitter : @dadoonet / @elasticsearchfr / @scrutmydocs

Le 25 juil. 2013 à 03:24, Pablo Molnar [pablomolnar@gmail.com](mailto:pablomolnar@gmail.com) a écrit :

Hello fellas,

It is possible to have an analyzer that the result is the combination of other two analyzers ("keyword" and "standard" in my case)

e.g.: Given "twenty-eight-year-old"

/\_analyze?text=twenty-eight-year-old&analyzer=standard returns [twenty, eight, year, old]  
/\_analyze?text=twenty-eight-year-old&analyzer=keyword returns [twenty-eight-year-old]

My goal is having a single analyzer that returns [twenty-eight-year-old, twenty,eight, year, old]

## Thanks, Pablo

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:** ![Pablo\_Molnar](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/pablo_molnar/32/2200_2.png) [@Pablo\_Molnar](https://discuss.elastic.co/u/Pablo_Molnar)\
**Post date:** [July 25, 2013, 7:09am UTC](https://discuss.elastic.co/t/combining-analyzer-tokenizer-in-one/12926/3 "2013-07-25T07:09:37Z")

</div>

Hi David,

I'm aware about the multifield feature but the thing is I wanna leave the  
consumer logic the most transparent/clean/decouple as possible (avoiding  
conditionals, hitting ES more than once or know about internal stuff like  
field.$analyzer)

On Wed, Jul 24, 2013 at 7:57 PM, David Pilato [david@pilato.fr](mailto:david@pilato.fr) wrote:

> Not exactly the answer you may expect but you could use multifield to set  
> both analyzers to the same field and then search in both _subfields_...
> 
> Does it help?
> 
> --  
> David 😉  
> Twitter : @dadoonet / @elasticsearchfr / @scrutmydocs
> 
> Le 25 juil. 2013 à 03:24, Pablo Molnar [pablomolnar@gmail.com](mailto:pablomolnar@gmail.com) a écrit :
> 
> Hello fellas,
> 
> It is possible to have an analyzer that the result is the combination of  
> other two analyzers ("keyword" and "standard" in my case)
> 
> e.g.: Given "_twenty-eight-year-old_"
> 
> /\_analyze?text=twenty-eight-year-old&analyzer=standard\* \*returns [twenty,  
> eight, year, old]  
> /\_analyze?text=twenty-eight-year-old&analyzer=keyword returns [  
> twenty-eight-year-old]
> 
> My goal is having a single analyzer that returns [twenty-eight-year-old, twenty,eight,  
> year, old]
> 
> Thanks,  
> Pablo
> 
> --  
> 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 a topic in the  
> Google Groups "elasticsearch" group.  
> To unsubscribe from this topic, visit  
> [https://groups.google.com/d/topic/elasticsearch/uonGcN6boeo/unsubscribe](https://groups.google.com/d/topic/elasticsearch/uonGcN6boeo/unsubscribe).  
> To unsubscribe from this group and all its topics, 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:** ![Benjamin\_Deveze](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/benjamin_deveze/32/1577_2.png) [@Benjamin\_Deveze](https://discuss.elastic.co/u/Benjamin_Deveze)\
**Post date:** [July 25, 2013, 4:06pm UTC](https://discuss.elastic.co/t/combining-analyzer-tokenizer-in-one/12926/4 "2013-07-25T16:06:51Z")

</div>

You should maybe have a look at the combo analyzer that you can find there:

> **[GitHub - yakaz/elasticsearch-analysis-combo: Elasticsearch Combo Analyzer](https://github.com/yakaz/elasticsearch-analysis-combo)**
>
> Elasticsearch Combo Analyzer. Contribute to yakaz/elasticsearch-analysis-combo development by creating an account on GitHub.

On Thursday, July 25, 2013 9:09:37 AM UTC+2, Pablo Molnar wrote:

> Hi David,
> 
> I'm aware about the multifield feature but the thing is I wanna leave the  
> consumer logic the most transparent/clean/decouple as possible (avoiding  
> conditionals, hitting ES more than once or know about internal stuff like  
> field.$analyzer)
> 
> On Wed, Jul 24, 2013 at 7:57 PM, David Pilato \<[da...@pilato.fr](mailto:da...@pilato.fr)\<javascript:\>
> 
> > wrote:
> 
> > Not exactly the answer you may expect but you could use multifield to set  
> > both analyzers to the same field and then search in both _subfields_...
> > 
> > Does it help?
> > 
> > --  
> > David 😉  
> > Twitter : @dadoonet / @elasticsearchfr / @scrutmydocs
> > 
> > Le 25 juil. 2013 à 03:24, Pablo Molnar \<[pablo...@gmail.com](mailto:pablo...@gmail.com) \<javascript:\>\>  
> > a écrit :
> > 
> > Hello fellas,
> > 
> > It is possible to have an analyzer that the result is the combination of  
> > other two analyzers ("keyword" and "standard" in my case)
> > 
> > e.g.: Given "_twenty-eight-year-old_"
> > 
> > /\_analyze?text=twenty-eight-year-old&analyzer=standard\* \*returns  
> > [twenty, eight, year, old]  
> > /\_analyze?text=twenty-eight-year-old&analyzer=keyword returns [  
> > twenty-eight-year-old]
> > 
> > My goal is having a single analyzer that returns [twenty-eight-year-old, twenty,eight,  
> > year, old]
> > 
> > Thanks,  
> > Pablo
> > 
> > --  
> > 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 a topic in the  
> > Google Groups "elasticsearch" group.  
> > To unsubscribe from this topic, visit  
> > [https://groups.google.com/d/topic/elasticsearch/uonGcN6boeo/unsubscribe](https://groups.google.com/d/topic/elasticsearch/uonGcN6boeo/unsubscribe).  
> > To unsubscribe from this group and all its topics, 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:** ![Pablo\_Molnar](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/pablo_molnar/32/2200_2.png) [@Pablo\_Molnar](https://discuss.elastic.co/u/Pablo_Molnar)\
**Post date:** [July 25, 2013, 6:02pm UTC](https://discuss.elastic.co/t/combining-analyzer-tokenizer-in-one/12926/5 "2013-07-25T18:02:32Z")

</div>

Thanks Benjamin, that was exactly what I was looking for.

On Thursday, July 25, 2013 9:06:51 AM UTC-7, Benjamin Devèze wrote:

> You should maybe have a look at the combo analyzer that you can find  
> there: [GitHub - yakaz/elasticsearch-analysis-combo: Elasticsearch Combo Analyzer](https://github.com/yakaz/elasticsearch-analysis-combo)
> 
> On Thursday, July 25, 2013 9:09:37 AM UTC+2, Pablo Molnar wrote:
> 
> > Hi David,
> > 
> > I'm aware about the multifield feature but the thing is I wanna leave the  
> > consumer logic the most transparent/clean/decouple as possible (avoiding  
> > conditionals, hitting ES more than once or know about internal stuff like  
> > field.$analyzer)
> > 
> > On Wed, Jul 24, 2013 at 7:57 PM, David Pilato [da...@pilato.fr](mailto:da...@pilato.fr) wrote:
> > 
> > > Not exactly the answer you may expect but you could use multifield to  
> > > set both analyzers to the same field and then search in both _subfields_...
> > > 
> > > Does it help?
> > > 
> > > --  
> > > David 😉  
> > > Twitter : @dadoonet / @elasticsearchfr / @scrutmydocs
> > > 
> > > Le 25 juil. 2013 à 03:24, Pablo Molnar [pablo...@gmail.com](mailto:pablo...@gmail.com) a écrit :
> > > 
> > > Hello fellas,
> > > 
> > > It is possible to have an analyzer that the result is the combination of  
> > > other two analyzers ("keyword" and "standard" in my case)
> > > 
> > > e.g.: Given "_twenty-eight-year-old_"
> > > 
> > > /\_analyze?text=twenty-eight-year-old&analyzer=standard\* \*returns  
> > > [twenty, eight, year, old]  
> > > /\_analyze?text=twenty-eight-year-old&analyzer=keyword returns [  
> > > twenty-eight-year-old]
> > > 
> > > My goal is having a single analyzer that returns [twenty-eight-year-old,  
> > > twenty,eight, year, old]
> > > 
> > > Thanks,  
> > > Pablo
> > > 
> > > --  
> > > 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).
> > > 
> > > 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 a topic in the  
> > > Google Groups "elasticsearch" group.  
> > > To unsubscribe from this topic, visit  
> > > [https://groups.google.com/d/topic/elasticsearch/uonGcN6boeo/unsubscribe](https://groups.google.com/d/topic/elasticsearch/uonGcN6boeo/unsubscribe).  
> > > To unsubscribe from this group and all its topics, send an email to  
> > > [elasticsearc...@googlegroups.com](mailto:elasticsearc...@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:** ![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:24am UTC](https://discuss.elastic.co/t/combining-analyzer-tokenizer-in-one/12926/6 "2017-07-06T02:24:30Z")

</div>


