# Using specific analyzer for each nested type?

**URL:** <https://discuss.elastic.co/t/using-specific-analyzer-for-each-nested-type/16132>\
**Category:** Elasticsearch\
**Created:** [March 4, 2014, 9:19am UTC](https://discuss.elastic.co/t/using-specific-analyzer-for-each-nested-type/16132 "2014-03-04T09:19:09Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Mohamed\_Hedi\_ABIDI](https://avatars.discourse-cdn.com/v4/letter/m/35a633/32.png) [@Mohamed\_Hedi\_ABIDI](https://discuss.elastic.co/u/Mohamed_Hedi_ABIDI)\
**Post date:** [March 4, 2014, 9:19am UTC](https://discuss.elastic.co/t/using-specific-analyzer-for-each-nested-type/16132/1 "2014-03-04T09:19:09Z")

</div>

Hi

I'm using nested types to manage multilingual : the root object contains  
values ​​for the default language, and I have several nested objects that  
represents translation in other languages : fr, gr, ar ...

Is there any way to define a specific analyzer for each nested type.

Thanks in advance.

--  
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/56aead44-f0d3-4525-8ca7-90bab8e06784%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/56aead44-f0d3-4525-8ca7-90bab8e06784%40googlegroups.com).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<div class="post-metadata">

**Author:** ![Mohamed\_Hedi\_ABIDI](https://avatars.discourse-cdn.com/v4/letter/m/35a633/32.png) [@Mohamed\_Hedi\_ABIDI](https://discuss.elastic.co/u/Mohamed_Hedi_ABIDI)\
**Post date:** [March 4, 2014, 4:34pm UTC](https://discuss.elastic.co/t/using-specific-analyzer-for-each-nested-type/16132/2 "2014-03-04T16:34:30Z")

</div>

Well, I found the answer : using dynamic template.

"person" : {  
"dynamic\_templates" : [  
{  
"nested\_template": {  
"match" : "fr|en",  
"match\_pattern" : "regex",  
"mapping" : {  
"type" : "nested"  
}  
}  
},  
{  
"template\_fr" : {  
"path\_match" : "fr._",  
"match\_mapping\_type" : "string",  
"mapping" : {  
"type" : "multi\_field",  
"fields" : {  
"{name}" : {"type": "string", "index" : "analyzed", "analyzer" :  
"fr\_analyzer"},  
"raw" : {"type": "string", "index" : "not\_analyzed"}  
}  
}  
}  
},  
{  
"template\_fr" : {  
"path\_match" : "en._",  
"match\_mapping\_type" : "string",  
"mapping" : {  
"type" : "multi\_field",  
"fields" : {  
"{name}" : {"type": "string", "index" : "analyzed", "analyzer" :  
"en\_analyzer"},  
"raw" : {"type": "string", "index" : "not\_analyzed"}  
}  
}  
}  
}  
]  
}

Le mardi 4 mars 2014 10:19:09 UTC+1, Mohamed Hedi ABIDI a écrit :

> Hi
> 
> I'm using nested types to manage multilingual : the root object contains  
> values ​​for the default language, and I have several nested objects that  
> represents translation in other languages : fr, gr, ar ...
> 
> Is there any way to define a specific analyzer for each nested type.
> 
> Thanks in advance.

--  
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/0b99e1d2-8f0b-466a-8c99-e610b7dbb47a%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/0b99e1d2-8f0b-466a-8c99-e610b7dbb47a%40googlegroups.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, 1:45am UTC](https://discuss.elastic.co/t/using-specific-analyzer-for-each-nested-type/16132/3 "2017-07-06T01:45:49Z")

</div>


