# Globally disable analysis (i.e. no via per-field mapping)?

**URL:** <https://discuss.elastic.co/t/globally-disable-analysis-i-e-no-via-per-field-mapping/21325>\
**Category:** Elasticsearch\
**Created:** [December 19, 2014, 7:15am UTC](https://discuss.elastic.co/t/globally-disable-analysis-i-e-no-via-per-field-mapping/21325 "2014-12-19T07:15:49Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![Eran\_Duchan](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/eran_duchan/32/1029_2.png) [@Eran\_Duchan](https://discuss.elastic.co/u/Eran_Duchan)\
**Post date:** [December 19, 2014, 7:15am UTC](https://discuss.elastic.co/t/globally-disable-analysis-i-e-no-via-per-field-mapping/21325/1 "2014-12-19T07:15:49Z")

</div>

I'd like not to use analysis across my schema to save a bit of CPU (I know  
the penalty this inflicts on searching). Right now I set "index":  
"not\_analyzed" per field but this is cumbersome.

I know I can choose between default analyzers  
[http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/analysis-analyzers.html](http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/analysis-analyzers.html)but  
there's no "none" analyzer to choose from. Short of writing a custom one  
that does nothing, is there a way to globally disable analysis?

Eran

--  
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/9d75b098-451c-488e-a29f-4e1b116538d1%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/9d75b098-451c-488e-a29f-4e1b116538d1%40googlegroups.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<div class="post-metadata">

**Author:** ![warkolm](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/warkolm/32/39224_2.png) [@warkolm](https://discuss.elastic.co/u/warkolm)\
**Post date:** [December 19, 2014, 7:57am UTC](https://discuss.elastic.co/t/globally-disable-analysis-i-e-no-via-per-field-mapping/21325/2 "2014-12-19T07:57:54Z")

</div>

It feels like you're almost defeating the whole purpose of using  
Elasticsearch with this approach! Is it really that much of a problem?

On 19 December 2014 at 08:15, Eran Duchan [pavius@gmail.com](mailto:pavius@gmail.com) wrote:

> I'd like not to use analysis across my schema to save a bit of CPU (I know  
> the penalty this inflicts on searching). Right now I set "index":  
> "not\_analyzed" per field but this is cumbersome.
> 
> I know I can choose between default analyzers  
> [http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/analysis-analyzers.html](http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/analysis-analyzers.html)but  
> there's no "none" analyzer to choose from. Short of writing a custom one  
> that does nothing, is there a way to globally disable analysis?
> 
> Eran
> 
> --  
> 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/9d75b098-451c-488e-a29f-4e1b116538d1%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/9d75b098-451c-488e-a29f-4e1b116538d1%40googlegroups.com)  
> [https://groups.google.com/d/msgid/elasticsearch/9d75b098-451c-488e-a29f-4e1b116538d1%40googlegroups.com?utm\_medium=email&utm\_source=footer](https://groups.google.com/d/msgid/elasticsearch/9d75b098-451c-488e-a29f-4e1b116538d1%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/CAEYi1X84G1wcWMz\_w9rwdBOug%3Dj6110%2Bd0\_5d\_HoPdCnS-jpxg%40mail.gmail.com](https://groups.google.com/d/msgid/elasticsearch/CAEYi1X84G1wcWMz_w9rwdBOug%3Dj6110%2Bd0_5d_HoPdCnS-jpxg%40mail.gmail.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<div class="post-metadata">

**Author:** ![Eran\_Duchan](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/eran_duchan/32/1029_2.png) [@Eran\_Duchan](https://discuss.elastic.co/u/Eran_Duchan)\
**Post date:** [December 19, 2014, 9:12am UTC](https://discuss.elastic.co/t/globally-disable-analysis-i-e-no-via-per-field-mapping/21325/3 "2014-12-19T09:12:29Z")

</div>

We use ElasticSearch to index our structured analytics data. We chose it  
for a few reasons:

1. All fields are indexed so we can search by any field or combination  
of fields, including nested fields
2. Flexible and built in geospatial searches
3. Can scale with our data, which grows at ~100M documents a day

It's pretty much a generic datastore (though not the source of truth).

While we do have quite a few string fields in our data, these are mostly  
enumeration values ("connected", "not connected") and in preliminary tests  
we've found that disabling analysis (per field) shows savings of ~5% CPU.  
Not a huge amount but every bit helps.

--  
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/ea428a1b-5b64-4992-8134-12a1ff4f0e97%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/ea428a1b-5b64-4992-8134-12a1ff4f0e97%40googlegroups.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<div class="post-metadata">

**Author:** ![jprante](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jprante/32/44941_2.png) [@jprante](https://discuss.elastic.co/u/jprante)\
**Post date:** [December 19, 2014, 9:51am UTC](https://discuss.elastic.co/t/globally-disable-analysis-i-e-no-via-per-field-mapping/21325/4 "2014-12-19T09:51:51Z")

</div>

The "keyword" analyzer is the "none" analyzer you are looking for.

Example settings:

{  
"index" : {  
"analysis" : {  
"analyzer" : {  
"default" : {  
"type" : "keyword"  
}  
}  
}  
}  
}

Jörg

On Fri, Dec 19, 2014 at 8:15 AM, Eran Duchan [pavius@gmail.com](mailto:pavius@gmail.com) wrote:

> I'd like not to use analysis across my schema to save a bit of CPU (I know  
> the penalty this inflicts on searching). Right now I set "index":  
> "not\_analyzed" per field but this is cumbersome.
> 
> I know I can choose between default analyzers  
> [http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/analysis-analyzers.html](http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/analysis-analyzers.html)but  
> there's no "none" analyzer to choose from. Short of writing a custom one  
> that does nothing, is there a way to globally disable analysis?
> 
> Eran
> 
> --  
> 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/9d75b098-451c-488e-a29f-4e1b116538d1%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/9d75b098-451c-488e-a29f-4e1b116538d1%40googlegroups.com)  
> [https://groups.google.com/d/msgid/elasticsearch/9d75b098-451c-488e-a29f-4e1b116538d1%40googlegroups.com?utm\_medium=email&utm\_source=footer](https://groups.google.com/d/msgid/elasticsearch/9d75b098-451c-488e-a29f-4e1b116538d1%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/CAKdsXoH%2B-wi22gGEunNUKO1uEdZjGHoFNXvaZQF-cVjWUicq5A%40mail.gmail.com](https://groups.google.com/d/msgid/elasticsearch/CAKdsXoH%2B-wi22gGEunNUKO1uEdZjGHoFNXvaZQF-cVjWUicq5A%40mail.gmail.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<div class="post-metadata">

**Author:** ![Eran\_Duchan](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/eran_duchan/32/1029_2.png) [@Eran\_Duchan](https://discuss.elastic.co/u/Eran_Duchan)\
**Post date:** [December 19, 2014, 10:23am UTC](https://discuss.elastic.co/t/globally-disable-analysis-i-e-no-via-per-field-mapping/21325/5 "2014-12-19T10:23:54Z")

</div>

Ahh, that should probably do the trick. 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/e9e3bac7-a74b-443b-a479-bac4891e324b%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/e9e3bac7-a74b-443b-a479-bac4891e324b%40googlegroups.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<div class="post-metadata">

**Author:** ![warkolm](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/warkolm/32/39224_2.png) [@warkolm](https://discuss.elastic.co/u/warkolm)\
**Post date:** [December 19, 2014, 10:30am UTC](https://discuss.elastic.co/t/globally-disable-analysis-i-e-no-via-per-field-mapping/21325/6 "2014-12-19T10:30:54Z")

</div>

Ok that makes a bit more sense, but it seems the amount of CPU you will  
save isn't worth the effort.

You could create an index template that matches fields with pattern "\*" and  
sets index: not\_analyzed, that'd be easiest.

On 19 December 2014 at 10:12, Eran Duchan [pavius@gmail.com](mailto:pavius@gmail.com) wrote:

> We use Elasticsearch to index our structured analytics data. We chose it  
> for a few reasons:
> 
> 1. All fields are indexed so we can search by any field or combination  
> of fields, including nested fields
> 2. Flexible and built in geospatial searches
> 3. Can scale with our data, which grows at ~100M documents a day
> 
> It's pretty much a generic datastore (though not the source of truth).
> 
> While we do have quite a few string fields in our data, these are mostly  
> enumeration values ("connected", "not connected") and in preliminary tests  
> we've found that disabling analysis (per field) shows savings of ~5% CPU.  
> Not a huge amount but every bit helps.
> 
> --  
> 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/ea428a1b-5b64-4992-8134-12a1ff4f0e97%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/ea428a1b-5b64-4992-8134-12a1ff4f0e97%40googlegroups.com)  
> [https://groups.google.com/d/msgid/elasticsearch/ea428a1b-5b64-4992-8134-12a1ff4f0e97%40googlegroups.com?utm\_medium=email&utm\_source=footer](https://groups.google.com/d/msgid/elasticsearch/ea428a1b-5b64-4992-8134-12a1ff4f0e97%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/CAEYi1X84eb6wUqOfMNS8uBqvS5DdGR%2BXZx\_zWZBdCKyfbkhH8A%40mail.gmail.com](https://groups.google.com/d/msgid/elasticsearch/CAEYi1X84eb6wUqOfMNS8uBqvS5DdGR%2BXZx_zWZBdCKyfbkhH8A%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, 12:42am UTC](https://discuss.elastic.co/t/globally-disable-analysis-i-e-no-via-per-field-mapping/21325/7 "2017-07-06T00:42:44Z")

</div>


