# Disabling analyzer for dynamically added fields

**URL:** <https://discuss.elastic.co/t/disabling-analyzer-for-dynamically-added-fields/12493>\
**Category:** Elasticsearch\
**Created:** [June 20, 2013, 10:40am UTC](https://discuss.elastic.co/t/disabling-analyzer-for-dynamically-added-fields/12493 "2013-06-20T10:40:21Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![David\_Milne](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/david_milne/32/2402_2.png) [@David\_Milne](https://discuss.elastic.co/u/David_Milne)\
**Post date:** [June 20, 2013, 10:40am UTC](https://discuss.elastic.co/t/disabling-analyzer-for-dynamically-added-fields/12493/1 "2013-06-20T10:40:21Z")

</div>

Hi there,

I have an index where the documents all look like this:

{  
id:,  
description:,  
answer\__:,  
annotation\__:  
}

The "answer\__" fields are dynamically added, like "answer\_isEnglish:yes" or  
"answer\_supportsTeam:Real Madrid". I want to do faceted searching on these,  
so I need them to not be tokenized. How could I have the description field  
analyzed and searchable as normal, and none of the "answer\__" fields  
analyzed?

Cheers,  
Dave

--  
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:** ![Christian\_Th](https://avatars.discourse-cdn.com/v4/letter/c/f14d63/32.png) [@Christian\_Th](https://discuss.elastic.co/u/Christian_Th)\
**Post date:** [June 20, 2013, 8:28pm UTC](https://discuss.elastic.co/t/disabling-analyzer-for-dynamically-added-fields/12493/2 "2013-06-20T20:28:38Z")

</div>

Does the following mapping helps you? Replace "soccer" -\> "your entity"

{  
"soccer": {  
"dynamic\_templates": [  
{  
"store\_generic": {  
"match": "answer\_\*",  
"mapping": {  
"index": "not\_analyzed",  
"store": "yes",  
"omit\_norms": "false",  
"index\_options": "positions"  
}  
}  
}  
]  
}  
}

Am Donnerstag, 20. Juni 2013 12:40:21 UTC+2 schrieb David Milne:

> Hi there,
> 
> I have an index where the documents all look like this:
> 
> {  
> id:,  
> description:,  
> answer\__:,  
> annotation\__:  
> }
> 
> The "answer\__" fields are dynamically added, like "answer\_isEnglish:yes"  
> or "answer\_supportsTeam:Real Madrid". I want to do faceted searching on  
> these, so I need them to not be tokenized. How could I have the description  
> field analyzed and searchable as normal, and none of the "answer\__" fields  
> analyzed?
> 
> Cheers,  
> Dave

--  
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:** ![cthoma](https://avatars.discourse-cdn.com/v4/letter/c/b487fb/32.png) [@cthoma](https://discuss.elastic.co/u/cthoma)\
**Post date:** [June 20, 2013, 8:43pm UTC](https://discuss.elastic.co/t/disabling-analyzer-for-dynamically-added-fields/12493/3 "2013-06-20T20:43:10Z")

</div>

You have to install the dynamic mapping before indexing content to the  
answer-fields. You can use something like the following mapping.  
Replace "soccer" with "your entity".

{  
"soccer": {  
"dynamic\_templates": [  
{  
"store\_generic": {  
"match": "answer\_\*",  
"mapping": {  
"index": "not\_analyzed",  
"store": "yes",  
"omit\_norms": "false",  
"index\_options": "positions"  
}  
}  
}  
]  
}  
}

Am Donnerstag, 20. Juni 2013 12:40:21 UTC+2 schrieb David Milne:

> Hi there,
> 
> I have an index where the documents all look like this:
> 
> {  
> id:,  
> description:,  
> answer\__:,  
> annotation\__:  
> }
> 
> The "answer\__" fields are dynamically added, like "answer\_isEnglish:yes"  
> or "answer\_supportsTeam:Real Madrid". I want to do faceted searching on  
> these, so I need them to not be tokenized. How could I have the description  
> field analyzed and searchable as normal, and none of the "answer\__" fields  
> analyzed?
> 
> Cheers,  
> Dave

--  
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:** ![David\_Milne](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/david_milne/32/2402_2.png) [@David\_Milne](https://discuss.elastic.co/u/David_Milne)\
**Post date:** [June 20, 2013, 10:41pm UTC](https://discuss.elastic.co/t/disabling-analyzer-for-dynamically-added-fields/12493/4 "2013-06-20T22:41:14Z")

</div>

Perfect, Thank You!

On Friday, June 21, 2013 6:43:10 AM UTC+10, cthoma wrote:

> You have to install the dynamic mapping before indexing content to the  
> answer-fields. You can use something like the following mapping.  
> Replace "soccer" with "your entity".
> 
> {  
> "soccer": {  
> "dynamic\_templates": [  
> {  
> "store\_generic": {  
> "match": "answer\_\*",  
> "mapping": {  
> "index": "not\_analyzed",  
> "store": "yes",  
> "omit\_norms": "false",  
> "index\_options": "positions"  
> }  
> }  
> }  
> ]  
> }  
> }
> 
> Am Donnerstag, 20. Juni 2013 12:40:21 UTC+2 schrieb David Milne:
> 
> > Hi there,
> > 
> > I have an index where the documents all look like this:
> > 
> > {  
> > id:,  
> > description:,  
> > answer\__:,  
> > annotation\__:  
> > }
> > 
> > The "answer\__" fields are dynamically added, like "answer\_isEnglish:yes"  
> > or "answer\_supportsTeam:Real Madrid". I want to do faceted searching on  
> > these, so I need them to not be tokenized. How could I have the description  
> > field analyzed and searchable as normal, and none of the "answer\__" fields  
> > analyzed?
> > 
> > Cheers,  
> > Dave

--  
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:30am UTC](https://discuss.elastic.co/t/disabling-analyzer-for-dynamically-added-fields/12493/5 "2017-07-06T02:30:07Z")

</div>


