# Issue with config/mappings/\_default

**URL:** <https://discuss.elastic.co/t/issue-with-config-mappings--default/3102>\
**Category:** Elasticsearch\
**Created:** [July 14, 2010, 8:00pm UTC](https://discuss.elastic.co/t/issue-with-config-mappings--default/3102 "2010-07-14T20:00:34Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Kenneth\_Loafman](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/kenneth_loafman/32/2224_2.png) [@Kenneth\_Loafman](https://discuss.elastic.co/u/Kenneth_Loafman)\
**Post date:** [July 14, 2010, 8:00pm UTC](https://discuss.elastic.co/t/issue-with-config-mappings--default/3102/1 "2010-07-14T20:00:34Z")

</div>

Hi,

If I put a mapping under |config/mappings/\_default|, restart, and try to  
save to a new index (auto-created), the save returns with a 500 error,  
NullPointerException (no diagnostics). If I do the following manually:

$ [create newindex]  
$ curl -XPUT '[http://192.168.1.4:9200/newindex/twitter/\_mapping](http://192.168.1.4:9200/newindex/twitter/_mapping)'   
-d "`cat /opt/elasticsearch-0.8.0/config/mappings/_default/twitter.json`"

then try to save to it, all is well. The problem is that I have to use  
auto-create for the index and I need to have different defaults than ES  
defaults for our mappings. If I knew I was creating a new index, then I  
could do a put-mapping and things would work, but I can't tell if it is  
new or old, that comes from the front end processing. I need to be able  
to set defaults on all the known doc types that we use, or have some  
quick (atomic) way to tell if an index already exists.

...Thanks,  
...Ken

---

<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:** [July 14, 2010, 8:04pm UTC](https://discuss.elastic.co/t/issue-with-config-mappings--default/3102/2 "2010-07-14T20:04:49Z")

</div>

Can you list the steps you take exactly that recreates the problem, and  
include the default mapping you use and the json you try to index?

On Wed, Jul 14, 2010 at 11:00 PM, Kenneth Loafman \<[kenneth.loafman@gmail.com](mailto:kenneth.loafman@gmail.com)

> wrote:

> Hi,
> 
> If I put a mapping under config/mappings/\_default, restart, and try to  
> save to a new index (auto-created), the save returns with a 500 error,  
> NullPointerException (no diagnostics). If I do the following manually:
> 
> $ [create newindex]  
> $ curl -XPUT '[http://192.168.1.4:9200/newindex/twitter/\_mapping](http://192.168.1.4:9200/newindex/twitter/_mapping)'   
> -d "`cat /opt/elasticsearch-0.8.0/config/mappings/_default/twitter.json`"
> 
> then try to save to it, all is well. The problem is that I have to use  
> auto-create for the index and I need to have different defaults than ES  
> defaults for our mappings. If I knew I was creating a new index, then I  
> could do a put-mapping and things would work, but I can't tell if it is new  
> or old, that comes from the front end processing. I need to be able to set  
> defaults on all the known doc types that we use, or have some quick (atomic)  
> way to tell if an index already exists.
> 
> ...Thanks,  
> ...Ken

---

<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, 4:22am UTC](https://discuss.elastic.co/t/issue-with-config-mappings--default/3102/3 "2017-07-06T04:22:13Z")

</div>


