# Disabling default analyzer

**URL:** <https://discuss.elastic.co/t/disabling-default-analyzer/4392>\
**Category:** Elasticsearch\
**Created:** [May 12, 2011, 5:26pm UTC](https://discuss.elastic.co/t/disabling-default-analyzer/4392 "2011-05-12T17:26:51Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Greg](https://avatars.discourse-cdn.com/v4/letter/g/71c47a/32.png) [@Greg](https://discuss.elastic.co/u/Greg)\
**Post date:** [May 12, 2011, 5:26pm UTC](https://discuss.elastic.co/t/disabling-default-analyzer/4392/1 "2011-05-12T17:26:51Z")

</div>

Hi all

A bit of a newbie question: I don't want elasticsearch to tokenize any  
of my fields. What is the best way to disable the default analyzer?

Alternatively, is it possible to have the automatic mapping default to  
"not\_analyzed" for each field?

Many thanks  
Greg

---

<div class="post-metadata">

**Author:** ![kimchy](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/kimchy/32/44952_2.png) [@kimchy](https://discuss.elastic.co/u/kimchy)\
**Post date:** [May 12, 2011, 9:53pm UTC](https://discuss.elastic.co/t/disabling-default-analyzer/4392/2 "2011-05-12T21:53:49Z")

</div>

Hey,

You have two options, the first is to set the default analyzer when you create an index to type keyword (which means treating the whole text as a single keyword). Here is a sample:

curl -XPUT localhost:9200/test -d '{  
"index" : {  
"analysis" : {  
"analyzer" : {  
"default" : {  
"type" : "keyword"  
}  
}  
}  
}  
}'

The other is to use dynamic\_tempaltes to have all string type fields to have index set to not\_analyzed. See dynamic template docs here: [Elasticsearch Platform — Find real-time answers at scale | Elastic](http://www.elasticsearch.org/guide/reference/mapping/root-object-type.html).  
On Thursday, May 12, 2011 at 8:26 PM, Greg wrote:  
Hi all

> A bit of a newbie question: I don't want elasticsearch to tokenize any  
> of my fields. What is the best way to disable the default analyzer?
> 
> Alternatively, is it possible to have the automatic mapping default to  
> "not\_analyzed" for each field?
> 
> Many thanks  
> Greg

---

<div class="post-metadata">

**Author:** ![Greg](https://avatars.discourse-cdn.com/v4/letter/g/71c47a/32.png) [@Greg](https://discuss.elastic.co/u/Greg)\
**Post date:** [May 12, 2011, 10:22pm UTC](https://discuss.elastic.co/t/disabling-default-analyzer/4392/3 "2011-05-12T22:22:43Z")

</div>

Perfect, thank you!

On May 12, 10:53 pm, Shay Banon [shay.ba...@elasticsearch.com](mailto:shay.ba...@elasticsearch.com) wrote:

> Hey,
> 
> You have two options, the first is to set the default analyzer when you create an index to type keyword (which means treating the whole text as a single keyword). Here is a sample:
> 
> curl -XPUT localhost:9200/test -d '{  
> "index" : {  
> "analysis" : {  
> "analyzer" : {  
> "default" : {  
> "type" : "keyword"
> 
> }  
> }  
> }  
> }  
> }'
> 
> The other is to use dynamic\_tempaltes to have all string type fields to have index set to not\_analyzed. See dynamic template docs here:[Elasticsearch Platform — Find real-time answers at scale | Elastic](http://www.elasticsearch.org/guide/reference/mapping/root-object-type....On) Thursday, May 12, 2011 at 8:26 PM, Greg wrote:
> 
> Hi all
> 
> > A bit of a newbie question: I don't want elasticsearch to tokenize any  
> > of my fields. What is the best way to disable the default analyzer?
> 
> > Alternatively, is it possible to have the automatic mapping default to  
> > "not\_analyzed" for each field?
> 
> > Many thanks  
> > Greg

---

<div class="post-metadata">

**Author:** ![kazoompa](https://avatars.discourse-cdn.com/v4/letter/k/e5b9ba/32.png) [@kazoompa](https://discuss.elastic.co/u/kazoompa)\
**Post date:** [April 9, 2013, 9:35pm UTC](https://discuss.elastic.co/t/disabling-default-analyzer/4392/4 "2013-04-09T21:35:06Z")

</div>

Hi,

I am also trying to not analyze ONE field. I tried to modify my default settings YAML by translating the documentaion JSON but no luck. I couldn't find any example that uses the YAML format.

Here is my settings in YAML:

index:  
analysis:  
analyzer:  
my\_index\_analyzer:  
type: custom  
tokenizer: standard  
filter: [standard,lowercase,my\_filter]  
my\_search\_analyzer:  
type: custom  
tokenizer: standard  
filter: [standard,lowercase]  
filter:  
my\_filter:  
type: nGram  
min\_gram: 2  
max\_gram: 20  
dynamic\_templates:  
exact\_match:  
match: fullName  
mapping:  
type: string  
fields:  
"{name}": "{type}": "{dynamic\_type}", index: not\_analyzed

I tried several version of the last line and no luck.

Any help will be greatly appreciated.

---

<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:41am UTC](https://discuss.elastic.co/t/disabling-default-analyzer/4392/5 "2017-07-06T02:41:57Z")

</div>


