# Analyzer for a field in a nested document?

**URL:** <https://discuss.elastic.co/t/analyzer-for-a-field-in-a-nested-document/8126>\
**Category:** Elasticsearch\
**Created:** [June 15, 2012, 10:56pm UTC](https://discuss.elastic.co/t/analyzer-for-a-field-in-a-nested-document/8126 "2012-06-15T22:56:36Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Andrew\_Cholakian](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/andrew_cholakian/32/1712_2.png) [@Andrew\_Cholakian](https://discuss.elastic.co/u/Andrew_Cholakian)\
**Post date:** [June 15, 2012, 10:56pm UTC](https://discuss.elastic.co/t/analyzer-for-a-field-in-a-nested-document/8126/1 "2012-06-15T22:56:36Z")

</div>

I have an array of nested documents which I need to specify an analyzer  
for. If anyone knows how to specify an analyzer for a nested document I'd  
greatly appreciate it.

Our documents look like

item: {  
labels: {  
label: {  
kind: "a str",  
color: "another str"  
}  
}  
}

If I wanted to use the keyword analyzer on 'kind' Where would I put that in  
my index mapping?

Help would be much appreciated, I've tried this many ways but can't seem to  
get it right.

---

<div class="post-metadata">

**Author:** ![Andrew\_Cholakian](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/andrew_cholakian/32/1712_2.png) [@Andrew\_Cholakian](https://discuss.elastic.co/u/Andrew_Cholakian)\
**Post date:** [June 16, 2012, 5:53am UTC](https://discuss.elastic.co/t/analyzer-for-a-field-in-a-nested-document/8126/2 "2012-06-16T05:53:01Z")

</div>

Ah, figured it out, you can put further properties below the nested type.

On Friday, June 15, 2012 3:56:36 PM UTC-7, Andrew Cholakian wrote:

> I have an array of nested documents which I need to specify an analyzer  
> for. If anyone knows how to specify an analyzer for a nested document I'd  
> greatly appreciate it.
> 
> Our documents look like
> 
> item: {  
> labels: {  
> label: {  
> kind: "a str",  
> color: "another str"  
> }  
> }  
> }
> 
> If I wanted to use the keyword analyzer on 'kind' Where would I put that  
> in my index mapping?
> 
> Help would be much appreciated, I've tried this many ways but can't seem  
> to get it right.

---

<div class="post-metadata">

**Author:** ![paul1](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/paul1/32/46819_2.png) [@paul1](https://discuss.elastic.co/u/paul1)\
**Post date:** [December 18, 2013, 12:15pm UTC](https://discuss.elastic.co/t/analyzer-for-a-field-in-a-nested-document/8126/3 "2013-12-18T12:15:45Z")

</div>

Hi Andrew,

can you please post your mapping how did u provide analyzer to nested field  
, i am facing the same problem.

Thanks  
Paul

On Saturday, 16 June 2012 11:23:01 UTC+5:30, Andrew Cholakian wrote:

> Ah, figured it out, you can put further properties below the nested type.
> 
> On Friday, June 15, 2012 3:56:36 PM UTC-7, Andrew Cholakian wrote:
> 
> > I have an array of nested documents which I need to specify an analyzer  
> > for. If anyone knows how to specify an analyzer for a nested document I'd  
> > greatly appreciate it.
> > 
> > Our documents look like
> > 
> > item: {  
> > labels: {  
> > label: {  
> > kind: "a str",  
> > color: "another str"  
> > }  
> > }  
> > }
> > 
> > If I wanted to use the keyword analyzer on 'kind' Where would I put that  
> > in my index mapping?
> > 
> > Help would be much appreciated, I've tried this many ways but can't seem  
> > to get it right.

--  
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/2558de88-5856-4b52-aea3-57a5115a9e1f%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/2558de88-5856-4b52-aea3-57a5115a9e1f%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:** ![paul1](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/paul1/32/46819_2.png) [@paul1](https://discuss.elastic.co/u/paul1)\
**Post date:** [December 20, 2013, 11:47am UTC](https://discuss.elastic.co/t/analyzer-for-a-field-in-a-nested-document/8126/4 "2013-12-20T11:47:50Z")

</div>

got it 🙂

On Wednesday, 18 December 2013 17:45:45 UTC+5:30, paul wrote:

> Hi Andrew,
> 
> can you please post your mapping how did u provide analyzer to nested  
> field , i am facing the same problem.
> 
> Thanks  
> Paul
> 
> On Saturday, 16 June 2012 11:23:01 UTC+5:30, Andrew Cholakian wrote:
> 
> > Ah, figured it out, you can put further properties below the nested type.
> > 
> > On Friday, June 15, 2012 3:56:36 PM UTC-7, Andrew Cholakian wrote:
> > 
> > > I have an array of nested documents which I need to specify an analyzer  
> > > for. If anyone knows how to specify an analyzer for a nested document I'd  
> > > greatly appreciate it.
> > > 
> > > Our documents look like
> > > 
> > > item: {  
> > > labels: {  
> > > label: {  
> > > kind: "a str",  
> > > color: "another str"  
> > > }  
> > > }  
> > > }
> > > 
> > > If I wanted to use the keyword analyzer on 'kind' Where would I put that  
> > > in my index mapping?
> > > 
> > > Help would be much appreciated, I've tried this many ways but can't seem  
> > > to get it right.

--  
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/8f2ff7e0-f657-459d-b600-b9fead5b1a4d%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/8f2ff7e0-f657-459d-b600-b9fead5b1a4d%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:** ![bigerock](https://avatars.discourse-cdn.com/v4/letter/b/4bbf92/32.png) [@bigerock](https://discuss.elastic.co/u/bigerock)\
**Post date:** [June 18, 2014, 5:54pm UTC](https://discuss.elastic.co/t/analyzer-for-a-field-in-a-nested-document/8126/5 "2014-06-18T17:54:20Z")

</div>

could you please post the solution?

---

<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:21am UTC](https://discuss.elastic.co/t/analyzer-for-a-field-in-a-nested-document/8126/6 "2017-07-06T01:21:27Z")

</div>


