# Definition of path based analyzer for nested documents

**URL:** <https://discuss.elastic.co/t/definition-of-path-based-analyzer-for-nested-documents/20632>\
**Category:** Elasticsearch\
**Created:** [November 7, 2014, 11:20am UTC](https://discuss.elastic.co/t/definition-of-path-based-analyzer-for-nested-documents/20632 "2014-11-07T11:20:22Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![christian\_4](https://avatars.discourse-cdn.com/v4/letter/c/c68b51/32.png) [@christian\_4](https://discuss.elastic.co/u/christian_4)\
**Post date:** [November 7, 2014, 11:20am UTC](https://discuss.elastic.co/t/definition-of-path-based-analyzer-for-nested-documents/20632/1 "2014-11-07T11:20:22Z")

</div>

Hello!

Out data model in ES roughly looks as follows:

{  
"translation" : {  
"\_id" : {  
"path" : "id"  
},  
"\_all" : {  
"enabled" : "false"  
},  
"dynamic" : "strict",  
"properties" : {  
"id" : { "type" : "string", "index" :  
"not\_analyzed" },  
"groupId" : { "type" : "string", "index" :  
"not\_analyzed" },  
"segments" : {  
"type" : "nested",  
"\_analyzer" : {  
"path" : "analyzer\_name"  
},  
"properties" : {  
"id" : { "type" : "string", "index" :  
"not\_analyzed" },  
"analyzer\_name" : { "type" : "string", "index" :  
"not\_analyzed" },  
"type" : { "type" : "string", "index" :  
"not\_analyzed" },  
"lang" : { "type" : "string", "index" :  
"not\_analyzed" },  
"content" : { "type" : "string" }  
}  
}  
}  
}  
}

So we basically model a translation entity as a document which can contain  
an arbitrary number of nested documents - each holding the translation for  
a specific language.  
What I'm trying to achieve is to define a language specific analyzer for  
the content field based on the value of the analyzer\_name field. While the  
mapping can be created without problems it seems that the analyzer defined  
in the analyzer\_name field is not used but instead the content of each  
nested document is analyzed using the default analyzer.  
As far as I understand nested documents are internally indexed as separate  
documents, so it would be interesting why this is not possible. Or am I  
missing some important point here?

br,

Christian

--  
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/f47adce9-d8cb-4bc6-a5b4-7b39371c2203%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/f47adce9-d8cb-4bc6-a5b4-7b39371c2203%40googlegroups.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:51am UTC](https://discuss.elastic.co/t/definition-of-path-based-analyzer-for-nested-documents/20632/2 "2017-07-06T00:51:32Z")

</div>


