# Default index analyzer in elasticsearch

**URL:** <https://discuss.elastic.co/t/default-index-analyzer-in-elasticsearch/17264>\
**Category:** Elasticsearch\
**Created:** [April 29, 2014, 2:06pm UTC](https://discuss.elastic.co/t/default-index-analyzer-in-elasticsearch/17264 "2014-04-29T14:06:39Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Piyush\_Rai](https://avatars.discourse-cdn.com/v4/letter/p/90ced4/32.png) [@Piyush\_Rai](https://discuss.elastic.co/u/Piyush_Rai)\
**Post date:** [April 29, 2014, 2:06pm UTC](https://discuss.elastic.co/t/default-index-analyzer-in-elasticsearch/17264/1 "2014-04-29T14:06:39Z")

</div>

I am facing a problem with elasticsearch where I dont want my indexed term  
to be analyzed. But the elasticsearch has some default setting which is  
tokenizing it on space. Therefore my facet query is not returning the  
result I want.

I read that "index" : "not\_analyzed" in properties of index type should  
work. But the problem is that I dont know my document structure before  
hand. I would be indexing random MySQL databases to elasticsearch without  
knowing the table structure.

How can I setup elasticsearch such that by default it uses "index" :  
"not\_analyzed" until otherwise asked for. Thanks

PS: I am using java if I can directly use any API for it I would love it.

--  
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/5a6d9c36-ab27-491f-a7f5-9fc90f3fe802%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/5a6d9c36-ab27-491f-a7f5-9fc90f3fe802%40googlegroups.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<div class="post-metadata">

**Author:** ![radu\_gheorghe](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/radu_gheorghe/32/556_2.png) [@radu\_gheorghe](https://discuss.elastic.co/u/radu_gheorghe)\
**Post date:** [April 29, 2014, 2:55pm UTC](https://discuss.elastic.co/t/default-index-analyzer-in-elasticsearch/17264/2 "2014-04-29T14:55:48Z")

</div>

Hello Piyush,

You could set the default mapping for all strings to be not\_analyzed by  
using dynamic templates:

> **[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.

Alternatively, you can set the default analyzer to "keyword":

> **[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.

Best regards,  
Radu

--  
Performance Monitoring \* Log Analytics \* Search Analytics  
Solr & Elasticsearch Support \* [http://sematext.com/](http://sematext.com/)

On Tue, Apr 29, 2014 at 5:06 PM, Piyush Rai [piyushrai23@gmail.com](mailto:piyushrai23@gmail.com) wrote:

> I am facing a problem with elasticsearch where I dont want my indexed term  
> to be analyzed. But the elasticsearch has some default setting which is  
> tokenizing it on space. Therefore my facet query is not returning the  
> result I want.
> 
> I read that "index" : "not\_analyzed" in properties of index type should  
> work. But the problem is that I dont know my document structure before  
> hand. I would be indexing random MySQL databases to elasticsearch without  
> knowing the table structure.
> 
> How can I setup elasticsearch such that by default it uses "index" :  
> "not\_analyzed" until otherwise asked for. Thanks
> 
> PS: I am using java if I can directly use any API for it I would love it.
> 
> --  
> 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/5a6d9c36-ab27-491f-a7f5-9fc90f3fe802%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/5a6d9c36-ab27-491f-a7f5-9fc90f3fe802%40googlegroups.com)[https://groups.google.com/d/msgid/elasticsearch/5a6d9c36-ab27-491f-a7f5-9fc90f3fe802%40googlegroups.com?utm\_medium=email&utm\_source=footer](https://groups.google.com/d/msgid/elasticsearch/5a6d9c36-ab27-491f-a7f5-9fc90f3fe802%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/CAHXA0\_2pVZ5QYVT\_XqYprCJHa0tCVUGydDW03D4p9nowNHwJRA%40mail.gmail.com](https://groups.google.com/d/msgid/elasticsearch/CAHXA0_2pVZ5QYVT_XqYprCJHa0tCVUGydDW03D4p9nowNHwJRA%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:32am UTC](https://discuss.elastic.co/t/default-index-analyzer-in-elasticsearch/17264/3 "2017-07-06T01:32:42Z")

</div>


