# How to forbid the analyzing for a certain data type (e.g. string)

**URL:** <https://discuss.elastic.co/t/how-to-forbid-the-analyzing-for-a-certain-data-type-e-g-string/19090>\
**Category:** Elasticsearch\
**Created:** [August 5, 2014, 11:08am UTC](https://discuss.elastic.co/t/how-to-forbid-the-analyzing-for-a-certain-data-type-e-g-string/19090 "2014-08-05T11:08:13Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![11149](https://avatars.discourse-cdn.com/v4/letter/1/da6949/32.png) [@11149](https://discuss.elastic.co/u/11149)\
**Post date:** [August 5, 2014, 11:08am UTC](https://discuss.elastic.co/t/how-to-forbid-the-analyzing-for-a-certain-data-type-e-g-string/19090/1 "2014-08-05T11:08:13Z")

</div>

Hi all:

we gathering data(in json format) from user input. I want to know is there  
any way to forbid the analyzing process for certain data type(e.g. string),  
so that if we detect the value of some field is in string format, we will  
not analyze it.

thanks

--  
不学习，不知道

--  
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/CA%2BJstLBM\_%3D6EEChk9vB0K1gtJpBAiXgTcFn7PC5bHsTDBTG%2Brw%40mail.gmail.com](https://groups.google.com/d/msgid/elasticsearch/CA%2BJstLBM_%3D6EEChk9vB0K1gtJpBAiXgTcFn7PC5bHsTDBTG%2Brw%40mail.gmail.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<div class="post-metadata">

**Author:** ![Tihomir\_Lichev1](https://avatars.discourse-cdn.com/v4/letter/t/f08c70/32.png) [@Tihomir\_Lichev1](https://discuss.elastic.co/u/Tihomir_Lichev1)\
**Post date:** [August 5, 2014, 12:10pm UTC](https://discuss.elastic.co/t/how-to-forbid-the-analyzing-for-a-certain-data-type-e-g-string/19090/2 "2014-08-05T12:10:17Z")

</div>

Probably you should use dynamic templates for mappings:

> **[Elasticsearch Platform — Find real-time answers at scale](https://www.elastic.co)**
>
> Power insights and outcomes with the Elasticsearch Platform and AI. See into your data and find answers that matter with enterprise solutions designed to help you build, observe, and protect. Try Elasticsearch free today.

05 август 2014, вторник, 14:08:29 UTC+3, 潘飞 написа:

> Hi all:
> 
> we gathering data(in json format) from user input. I want to know is there  
> any way to forbid the analyzing process for certain data type(e.g. string),  
> so that if we detect the value of some field is in string format, we will  
> not analyze it.
> 
> thanks
> 
> --  
> 不学习，不知道

--  
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/f7b3f7b2-e9e4-42e6-812e-0edd33c7478f%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/f7b3f7b2-e9e4-42e6-812e-0edd33c7478f%40googlegroups.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<div class="post-metadata">

**Author:** ![11149](https://avatars.discourse-cdn.com/v4/letter/1/da6949/32.png) [@11149](https://discuss.elastic.co/u/11149)\
**Post date:** [August 6, 2014, 7:24am UTC](https://discuss.elastic.co/t/how-to-forbid-the-analyzing-for-a-certain-data-type-e-g-string/19090/3 "2014-08-06T07:24:01Z")

</div>

Hi Thanks very much, I resolve it using :

curl -XPUT "[http://localhost:9200/\_template/not\_analyzed\_template](http://localhost:9200/_template/not_analyzed_template)" -d'  
{  
"template": "test\*",  
"mappings": {  
"_default_": {  
"dynamic\_templates": [  
{  
"template\_1": {  
"mapping": {  
"index": "not\_analyzed",  
"type": "string"  
},  
"match\_mapping\_type": "string",  
"match": "\*"  
}  
}  
],  
\_all: {  
"enabled": false  
}  
}  
}  
}

2014-08-05 20:10 GMT+08:00 Tihomir Lichev [shoteff@gmail.com](mailto:shoteff@gmail.com):

> Probably you should use dynamic templates for mappings:
> 
> [Elasticsearch Platform — Find real-time answers at scale | Elastic](http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/mapping-root-object-type.html#_dynamic_templates)
> 
> 05 август 2014, вторник, 14:08:29 UTC+3, 潘飞 написа:
> 
> > Hi all:
> > 
> > we gathering data(in json format) from user input. I want to know is  
> > there any way to forbid the analyzing process for certain data type(e.g.  
> > string), so that if we detect the value of some field is in string format,  
> > we will not analyze it.
> > 
> > thanks
> > 
> > --  
> > 不学习，不知道
> 
> --  
> 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/f7b3f7b2-e9e4-42e6-812e-0edd33c7478f%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/f7b3f7b2-e9e4-42e6-812e-0edd33c7478f%40googlegroups.com)  
> [https://groups.google.com/d/msgid/elasticsearch/f7b3f7b2-e9e4-42e6-812e-0edd33c7478f%40googlegroups.com?utm\_medium=email&utm\_source=footer](https://groups.google.com/d/msgid/elasticsearch/f7b3f7b2-e9e4-42e6-812e-0edd33c7478f%40googlegroups.com?utm_medium=email&utm_source=footer)  
> .  
> For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

--  
不学习，不知道

--  
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/CA%2BJstLAUVCmp8iv2HwO7zWMo1TzoBHHEvNqdzRQPL9zhX8%2BwXQ%40mail.gmail.com](https://groups.google.com/d/msgid/elasticsearch/CA%2BJstLAUVCmp8iv2HwO7zWMo1TzoBHHEvNqdzRQPL9zhX8%2BwXQ%40mail.gmail.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, 1:10am UTC](https://discuss.elastic.co/t/how-to-forbid-the-analyzing-for-a-certain-data-type-e-g-string/19090/4 "2017-07-06T01:10:34Z")

</div>


