# Default-mapping.json

**URL:** <https://discuss.elastic.co/t/default-mapping-json/6111>\
**Category:** Elasticsearch\
**Created:** [December 9, 2011, 7:36pm UTC](https://discuss.elastic.co/t/default-mapping-json/6111 "2011-12-09T19:36:12Z")\
**Posts on this page:** 14\
**Page:** 2

<div class="post-metadata">

**Author:** ![dadoonet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dadoonet/32/137187_2.png) [@dadoonet](https://discuss.elastic.co/u/dadoonet)\
**Post date:** [December 14, 2011, 2:11pm UTC](https://discuss.elastic.co/t/default-mapping-json/6111/21 "2011-12-14T14:11:50Z")

</div>

Okay : Test done with ES 0.18.5 under windows with a fresh and clean install.

Step 4 produces :  
{  
"test" : {  
"type" : {  
"\_source" : {  
"enabled" : false  
},  
"properties" : {  
"test" : {  
"type" : "string"  
}  
}  
}  
}  
}

So Slavag seems to have something strange on its side as he said that he got for  
step 4 :  
{  
"test" : {  
"type" : {  
"properties" : {  
"test" : {  
"type" : "string"  
}  
}  
}  
}  
}

HTH,  
David.

Le 13 décembre 2011 à 23:10, Shay Banon [kimchy@gmail.com](mailto:kimchy@gmail.com) a écrit :

> I am not really sure..., I don't see where the problem is. Can someone else  
> try and recreate this problem, or verify that its not happening? I will  
> repeat the recreation:
> 
> 1. Use a fresh elasticsearch 0.18.5 installation.
> 2. Place a file called default-mapping.json under config with the following  
> content:
> 
> {  
> "_default_" : {  
> "\_source" : {"enabled" : false}  
> }  
> }
> 
> 1. Index a sample document: curl -XPUT localhost:9200/test/type/1 -d  
> '{"test" : "value"}'
> 2. Execute: curl localhost:9200/test/\_mapping?pretty=1, and check if it has  
> source enabled or not in the mapping returned.
> 
> Thanks!
> 
> On Tue, Dec 13, 2011 at 11:58 PM, slavag [slavago@gmail.com](mailto:slavago@gmail.com) wrote:
> 
> > Shay , any suggestion about my problem ?
> > 
> > Thank You.

--  
David Pilato  
[http://dev.david.pilato.fr/](http://dev.david.pilato.fr/)  
Twitter : @dadoonet

---

<div class="post-metadata">

**Author:** ![Slava\_G](https://avatars.discourse-cdn.com/v4/letter/s/e9c0ed/32.png) [@Slava\_G](https://discuss.elastic.co/u/Slava_G)\
**Post date:** [December 14, 2011, 2:14pm UTC](https://discuss.elastic.co/t/default-mapping-json/6111/22 "2011-12-14T14:14:08Z")

</div>

Hi David,  
Can you please run this curl -XGET localhost:9200/test/\_search?pretty=true  
-d '  
{  
"query" : {  
"term" : { "test" : "value" }  
}  
}  
'  
What is the result ?

---

<div class="post-metadata">

**Author:** ![dadoonet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dadoonet/32/137187_2.png) [@dadoonet](https://discuss.elastic.co/u/dadoonet)\
**Post date:** [December 14, 2011, 2:33pm UTC](https://discuss.elastic.co/t/default-mapping-json/6111/23 "2011-12-14T14:33:12Z")

</div>

Sure.

First, it's a POST request not a GET.

I get a single hit without source :  
{  
"took":0,  
"timed\_out":false,  
"\_shards":{  
"total":5,  
"successful":5,  
"failed":0  
},  
"hits":{  
"total":1,  
"max\_score":0.30685282,  
"hits":[{  
"\_index":"test",  
"\_type":"type",  
"\_id":"1",  
"\_score":0.30685282  
}  
]  
}  
}

Le 14 décembre 2011 à 15:14, slavag [slavago@gmail.com](mailto:slavago@gmail.com) a écrit :

> Hi David,  
> Can you please run this curl -XGET localhost:9200/test/\_search?pretty=true  
> -d '  
> {  
> "query" : {  
> "term" : { "test" : "value" }  
> }  
> }  
> '  
> What is the result ?  
> --  
> David Pilato  
> [http://dev.david.pilato.fr/](http://dev.david.pilato.fr/)  
> Twitter : @dadoonet

---

<div class="post-metadata">

**Author:** ![Slava\_G](https://avatars.discourse-cdn.com/v4/letter/s/e9c0ed/32.png) [@Slava\_G](https://discuss.elastic.co/u/Slava_G)\
**Post date:** [December 14, 2011, 2:37pm UTC](https://discuss.elastic.co/t/default-mapping-json/6111/24 "2011-12-14T14:37:07Z")

</div>

Hi David,  
GET worked also, but any way I did POST and get :  
{  
"took" : 5,  
"timed\_out" : false,  
"\_shards" : {  
"total" : 5,  
"successful" : 5,  
"failed" : 0  
},  
"hits" : {  
"total" : 1,  
"max\_score" : 0.30685282,  
"hits" : [ {  
"\_index" : "test",  
"\_type" : "type",  
"\_id" : "1",  
"\_score" : 0.30685282, "\_source" : {"test" : "value"}  
} ]  
}  
}

When curl localhost:9200/test/\_mapping?pretty=1 :  
returns :  
{  
"test" : {  
"type" : {  
"properties" : {  
"test" : {  
"type" : "string"  
}  
}  
}  
}  
}

So, what could be a problem - I did exactly what you did and Shay said and  
we have different results in search ?

Thank You.

---

<div class="post-metadata">

**Author:** ![dadoonet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dadoonet/32/137187_2.png) [@dadoonet](https://discuss.elastic.co/u/dadoonet)\
**Post date:** [December 14, 2011, 2:53pm UTC](https://discuss.elastic.co/t/default-mapping-json/6111/25 "2011-12-14T14:53:08Z")

</div>

I test it under windows using mobz inteface. That's perhaps why GET produces  
nothing for me...  
BTW, I remember having some troubles some months ago with mappings in conf dir.

Let me tell something that not answer directly to your concern. It could be a  
better idea to send mapping to an ES node instead of having to copy on each node  
a conf file.

BTW, are you really sure that your 0.18.5 is a fresh one ?  
Do you have some globals var in your system (what printenv produces ?) ?

David.

Le 14 décembre 2011 à 15:37, slavag [slavago@gmail.com](mailto:slavago@gmail.com) a écrit :

> Hi David,  
> GET worked also, but any way I did POST and get :  
> {  
> "took" : 5,  
> "timed\_out" : false,  
> "\_shards" : {  
> "total" : 5,  
> "successful" : 5,  
> "failed" : 0  
> },  
> "hits" : {  
> "total" : 1,  
> "max\_score" : 0.30685282,  
> "hits" : [ {  
> "\_index" : "test",  
> "\_type" : "type",  
> "\_id" : "1",  
> "\_score" : 0.30685282, "\_source" : {"test" : "value"}  
> } ]  
> }  
> }
> 
> When curl localhost:9200/test/\_mapping?pretty=1 :  
> returns :  
> {  
> "test" : {  
> "type" : {  
> "properties" : {  
> "test" : {  
> "type" : "string"  
> }  
> }  
> }  
> }  
> }
> 
> So, what could be a problem - I did exactly what you did and Shay said and  
> we have different results in search ?
> 
> Thank You.  
> --  
> David Pilato  
> [http://dev.david.pilato.fr/](http://dev.david.pilato.fr/)  
> Twitter : @dadoonet

---

<div class="post-metadata">

**Author:** ![Slava\_G](https://avatars.discourse-cdn.com/v4/letter/s/e9c0ed/32.png) [@Slava\_G](https://discuss.elastic.co/u/Slava_G)\
**Post date:** [December 14, 2011, 4:14pm UTC](https://discuss.elastic.co/t/default-mapping-json/6111/26 "2011-12-14T16:14:34Z")

</div>

Hi David,  
Thank for quick response , per your question - yes this is fresh 18.5 -  
just unpacked it and put the mapping in the config.  
Can you describe a little bit more the sending mapping to an ES node ?  
As for global vars in the system I don't see any special, but is there some  
global vars that has effect on the ES ?

Best Regards.

---

<div class="post-metadata">

**Author:** ![dadoonet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dadoonet/32/137187_2.png) [@dadoonet](https://discuss.elastic.co/u/dadoonet)\
**Post date:** [December 14, 2011, 4:36pm UTC](https://discuss.elastic.co/t/default-mapping-json/6111/27 "2011-12-14T16:36:20Z")

</div>

Here is a gist :[Create Mappings · GitHub](https://gist.github.com/1477309)

> <https://gist.github.com/dadoonet/1477309>

is the unix script to push mapping files to a node (localhost:9200)  
./createMapping mymapping

It sends the mymapping.json file to ES. Then ES spread the mapping to each  
nodes.

> <https://gist.github.com/dadoonet/1477309>

Is a sample mapping JSON file

Not sure that is what you are after but may help...

About ES VARS, I was only thinking about ES\_JAVA\_OPTS or JAVA\_OPTS in which you  
can have defined a -Des.path.data or -Des.path.conf or something like that.

Cheers

Le 14 décembre 2011 à 17:14, slavag [slavago@gmail.com](mailto:slavago@gmail.com) a écrit :

> Hi David,  
> Thank for quick response , per your question - yes this is fresh 18.5 -  
> just unpacked it and put the mapping in the config.  
> Can you describe a little bit more the sending mapping to an ES node ?  
> As for global vars in the system I don't see any special, but is there some  
> global vars that has effect on the ES ?
> 
> Best Regards.  
> --  
> David Pilato  
> [http://dev.david.pilato.fr/](http://dev.david.pilato.fr/)  
> Twitter : @dadoonet

---

<div class="post-metadata">

**Author:** ![Slava\_G](https://avatars.discourse-cdn.com/v4/letter/s/e9c0ed/32.png) [@Slava\_G](https://discuss.elastic.co/u/Slava_G)\
**Post date:** [December 14, 2011, 7:11pm UTC](https://discuss.elastic.co/t/default-mapping-json/6111/28 "2011-12-14T19:11:33Z")

</div>

David, Thank You a lot.  
Looking on the script and it seems that i need it of each index, now when  
my application is multi-tanant application and new index are coming as new  
customer is join and even more the new index types are also can come pretty  
often. So it means that I need to put mapping for every new tenant (new  
index) / for every new index type.  
Do you see any other solution to my case - btw, the mapping that I need for  
all index type and for all tenants ( at least the the mandatory fields) are  
very few : some date, id of data and user account. Those are 3 fields that  
I need to store and not analyze and I have to not store \_source.

Any suggestions ?

Thank You very much for your assistance.

---

<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:** [December 14, 2011, 10:04pm UTC](https://discuss.elastic.co/t/default-mapping-json/6111/29 "2011-12-14T22:04:52Z")

</div>

default-mapping.json works. Can you check in your logs again if you see the  
node you start joining another node?

On Wed, Dec 14, 2011 at 9:11 PM, slavag [slavago@gmail.com](mailto:slavago@gmail.com) wrote:

> David, Thank You a lot.  
> Looking on the script and it seems that i need it of each index, now when  
> my application is multi-tanant application and new index are coming as new  
> customer is join and even more the new index types are also can come pretty  
> often. So it means that I need to put mapping for every new tenant (new  
> index) / for every new index type.  
> Do you see any other solution to my case - btw, the mapping that I need  
> for all index type and for all tenants ( at least the the mandatory fields)  
> are very few : some date, id of data and user account. Those are 3 fields  
> that I need to store and not analyze and I have to not store \_source.
> 
> Any suggestions ?
> 
> Thank You very much for your assistance.

---

<div class="post-metadata">

**Author:** ![Slava\_G](https://avatars.discourse-cdn.com/v4/letter/s/e9c0ed/32.png) [@Slava\_G](https://discuss.elastic.co/u/Slava_G)\
**Post date:** [December 14, 2011, 10:09pm UTC](https://discuss.elastic.co/t/default-mapping-json/6111/30 "2011-12-14T22:09:17Z")

</div>

I checked, nothing - this is stand alone home computer.

---

<div class="post-metadata">

**Author:** ![Slava\_G](https://avatars.discourse-cdn.com/v4/letter/s/e9c0ed/32.png) [@Slava\_G](https://discuss.elastic.co/u/Slava_G)\
**Post date:** [December 16, 2011, 7:35am UTC](https://discuss.elastic.co/t/default-mapping-json/6111/31 "2011-12-16T07:35:22Z")

</div>

Hi Shay,

Any thought ? May be I need to check it in Linux OS ?

---

<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:** [December 16, 2011, 4:25pm UTC](https://discuss.elastic.co/t/default-mapping-json/6111/32 "2011-12-16T16:25:07Z")

</div>

Operating system does not matter. The only two reasons that I can think can  
cause it is that you are not using the config location you think you are  
using, or there is another node started that acts as the master with a  
different configuration.

On Fri, Dec 16, 2011 at 9:35 AM, slavag [slavago@gmail.com](mailto:slavago@gmail.com) wrote:

> Hi Shay,
> 
> Any thought ? May be I need to check it in Linux OS ?

---

<div class="post-metadata">

**Author:** ![Slava\_G](https://avatars.discourse-cdn.com/v4/letter/s/e9c0ed/32.png) [@Slava\_G](https://discuss.elastic.co/u/Slava_G)\
**Post date:** [December 16, 2011, 4:29pm UTC](https://discuss.elastic.co/t/default-mapping-json/6111/33 "2011-12-16T16:29:52Z")

</div>

As i said before - stand alone computer , as for config location - I never  
changed it.

---

<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, 3:45am UTC](https://discuss.elastic.co/t/default-mapping-json/6111/34 "2017-07-06T03:45:11Z")

</div>



[Previous page](https://discuss.elastic.co/t/default-mapping-json/6111.md?page=1)
