# Config'd mapping does not seem to take effect

**URL:** <https://discuss.elastic.co/t/configd-mapping-does-not-seem-to-take-effect/7706>\
**Category:** Elasticsearch\
**Created:** [May 15, 2012, 4:45pm UTC](https://discuss.elastic.co/t/configd-mapping-does-not-seem-to-take-effect/7706 "2012-05-15T16:45:37Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![searchgirl](https://avatars.discourse-cdn.com/v4/letter/s/e9a140/32.png) [@searchgirl](https://discuss.elastic.co/u/searchgirl)\
**Post date:** [May 15, 2012, 4:45pm UTC](https://discuss.elastic.co/t/configd-mapping-does-not-seem-to-take-effect/7706/1 "2012-05-15T16:45:37Z")

</div>

Here is my setup:

- index: "en"
- type: "product"

the mapping file is at ES\_HOME/config/mappings/\_default/product.json  
it contains:

{  
"product" : {  
"dynamic\_templates" : [  
{  
"template\_1" : {  
"match" : "\*",  
"match\_mapping\_type" : "string",  
"mapping" : { "type" : "string", "omit\_norms" :  
"yes", "store": "no", "index": "not\_analyzed"}  
}  
}  
],  
"\_all" : {"enabled" : false},  
"properties" : {  
"pid" : {  
"type" : "string",  
"store" : "yes",  
"index" : "not\_analyzed"  
},  
"rid" : {  
"type" : "string",  
"store" : "yes",  
"index" : "not\_analyzed"  
},  
"pgrp" : {  
"type" : "string",  
"store" : "yes",  
"index" : "not\_analyzed"  
},  
"descl" : {  
"type" : "string",  
"store" : "no",  
"index" : "analyzed",  
"boost" : 1.0  
},  
"descs" : {  
"type" : "string",  
"store" : "no",  
"index" : "analyzed",  
"boost" : 1.3  
}  
}}}

Index is created like:

```
	node = NodeBuilder.nodeBuilder().data(true).node();
	client = node.client();

```

client.admin().indices().prepareCreate("en").execute().actionGet();

And indexed like:

```
	final IndexRequestBuilder irb = client.prepareIndex(getIndexName(),

```

getIndexType(), p.getProductId()).setSource(b);  
irb.execute().actionGet();

When I do a get, I get the following:

{  
\_index: "en",  
\_type: "product",  
\_id: "58d2ccf1-abc6-4a61-9eca-7c4d342b48c8",  
\_version: 2,  
exists: true,  
\_source: {  
pid: "58d2ccf1-abc6-4a61-9eca-7c4d342b48c8",  
rid: "44fe535f-4531-48bd-82d1-d96b6ef2bbe7",  
descl: "The Way Home",  
descs: "The Way Home"  
}  
}

I believe the mapping is not taking effect because "descl" & "descs"  
have been defined as "store":"no". My understanding is that these  
fields should not have been stored in the index and therefore should  
not be returned.

"[http://localhost:9200/en/\_settings](http://localhost:9200/en/_settings)" returned following which also  
indicate no mappings

{  
en: {  
settings: {  
index.number\_of\_shards: "5",  
index.number\_of\_replicas: "1",  
index.version.created: "190399"  
}  
}  
}

Questions: what am I doing wrong? Is there other ways to verify the  
mappings are properly applied? I am using Java client.

---

<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 17, 2012, 8:42pm UTC](https://discuss.elastic.co/t/configd-mapping-does-not-seem-to-take-effect/7706/2 "2012-05-17T20:42:05Z")

</div>

When you do a get mapping, do you see the one you defined? It looks good...

On Tue, May 15, 2012 at 7:45 PM, Helen Poon [helenchenpoon@gmail.com](mailto:helenchenpoon@gmail.com) wrote:

> Here is my setup:
> 
> - index: "en"
> - type: "product"
> 
> the mapping file is at ES\_HOME/config/mappings/\_default/product.json  
> it contains:
> 
> {  
> "product" : {  
> "dynamic\_templates" : [  
> {  
> "template\_1" : {  
> "match" : "\*",  
> "match\_mapping\_type" : "string",  
> "mapping" : { "type" : "string", "omit\_norms" :  
> "yes", "store": "no", "index": "not\_analyzed"}  
> }  
> }  
> ],  
> "\_all" : {"enabled" : false},  
> "properties" : {  
> "pid" : {  
> "type" : "string",  
> "store" : "yes",  
> "index" : "not\_analyzed"  
> },  
> "rid" : {  
> "type" : "string",  
> "store" : "yes",  
> "index" : "not\_analyzed"  
> },  
> "pgrp" : {  
> "type" : "string",  
> "store" : "yes",  
> "index" : "not\_analyzed"  
> },  
> "descl" : {  
> "type" : "string",  
> "store" : "no",  
> "index" : "analyzed",  
> "boost" : 1.0  
> },  
> "descs" : {  
> "type" : "string",  
> "store" : "no",  
> "index" : "analyzed",  
> "boost" : 1.3  
> }  
> }}}
> 
> Index is created like:
> 
> ```
> node = NodeBuilder.nodeBuilder().data(true).node();
> client = node.client();
> 
> ```
> 
> client.admin().indices().prepareCreate("en").execute().actionGet();
> 
> And indexed like:
> 
> ```
> final IndexRequestBuilder irb =
> 
> ```
> 
> client.prepareIndex(getIndexName(),  
> getIndexType(), p.getProductId()).setSource(b);  
> irb.execute().actionGet();
> 
> When I do a get, I get the following:
> 
> {  
> \_index: "en",  
> \_type: "product",  
> \_id: "58d2ccf1-abc6-4a61-9eca-7c4d342b48c8",  
> \_version: 2,  
> exists: true,  
> \_source: {  
> pid: "58d2ccf1-abc6-4a61-9eca-7c4d342b48c8",  
> rid: "44fe535f-4531-48bd-82d1-d96b6ef2bbe7",  
> descl: "The Way Home",  
> descs: "The Way Home"  
> }  
> }
> 
> I believe the mapping is not taking effect because "descl" & "descs"  
> have been defined as "store":"no". My understanding is that these  
> fields should not have been stored in the index and therefore should  
> not be returned.
> 
> "[http://localhost:9200/en/\_settings](http://localhost:9200/en/_settings)" returned following which also  
> indicate no mappings
> 
> {  
> en: {  
> settings: {  
> index.number\_of\_shards: "5",  
> index.number\_of\_replicas: "1",  
> index.version.created: "190399"  
> }  
> }  
> }
> 
> Questions: what am I doing wrong? Is there other ways to verify the  
> mappings are properly applied? I am using Java client.

---

<div class="post-metadata">

**Author:** ![Igor\_Motov](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/igor_motov/32/45193_2.png) [@Igor\_Motov](https://discuss.elastic.co/u/Igor_Motov)\
**Post date:** [May 20, 2012, 9:03am UTC](https://discuss.elastic.co/t/configd-mapping-does-not-seem-to-take-effect/7706/3 "2012-05-20T09:03:50Z")

</div>

When you specify "store":"no" in the mapping, it controls if the field is  
stored or not as a separate field. Your get request returns the source, not  
individual stored fields, so, the presence of the field in the source  
doesn't really indicate that the field was stored individually. You can  
disable storing source and remove fields from the source.  
See [Elasticsearch Platform — Find real-time answers at scale | Elastic](http://www.elasticsearch.org/guide/reference/mapping/source-field.html)  
for more details.

To verify that mapping was properly applied, simply run

curl 'localhost:9200/en/product/\_mapping'

On Tuesday, May 15, 2012 12:45:37 PM UTC-4, Helen Poon wrote:

> Here is my setup:
> 
> - index: "en"
> - type: "product"
> 
> the mapping file is at ES\_HOME/config/mappings/\_default/product.json  
> it contains:
> 
> {  
> "product" : {  
> "dynamic\_templates" : [  
> {  
> "template\_1" : {  
> "match" : "\*",  
> "match\_mapping\_type" : "string",  
> "mapping" : { "type" : "string", "omit\_norms" :  
> "yes", "store": "no", "index": "not\_analyzed"}  
> }  
> }  
> ],  
> "\_all" : {"enabled" : false},  
> "properties" : {  
> "pid" : {  
> "type" : "string",  
> "store" : "yes",  
> "index" : "not\_analyzed"  
> },  
> "rid" : {  
> "type" : "string",  
> "store" : "yes",  
> "index" : "not\_analyzed"  
> },  
> "pgrp" : {  
> "type" : "string",  
> "store" : "yes",  
> "index" : "not\_analyzed"  
> },  
> "descl" : {  
> "type" : "string",  
> "store" : "no",  
> "index" : "analyzed",  
> "boost" : 1.0  
> },  
> "descs" : {  
> "type" : "string",  
> "store" : "no",  
> "index" : "analyzed",  
> "boost" : 1.3  
> }  
> }}}
> 
> Index is created like:
> 
> ```
> node = NodeBuilder.nodeBuilder().data(true).node(); 
> client = node.client(); 
> 
> ```
> 
> client.admin().indices().prepareCreate("en").execute().actionGet();
> 
> And indexed like:
> 
> ```
> final IndexRequestBuilder irb = 
> 
> ```
> 
> client.prepareIndex(getIndexName(),  
> getIndexType(), p.getProductId()).setSource(b);  
> irb.execute().actionGet();
> 
> When I do a get, I get the following:
> 
> {  
> \_index: "en",  
> \_type: "product",  
> \_id: "58d2ccf1-abc6-4a61-9eca-7c4d342b48c8",  
> \_version: 2,  
> exists: true,  
> \_source: {  
> pid: "58d2ccf1-abc6-4a61-9eca-7c4d342b48c8",  
> rid: "44fe535f-4531-48bd-82d1-d96b6ef2bbe7",  
> descl: "The Way Home",  
> descs: "The Way Home"  
> }  
> }
> 
> I believe the mapping is not taking effect because "descl" & "descs"  
> have been defined as "store":"no". My understanding is that these  
> fields should not have been stored in the index and therefore should  
> not be returned.
> 
> "[http://localhost:9200/en/\_settings](http://localhost:9200/en/_settings)" returned following which also  
> indicate no mappings
> 
> {  
> en: {  
> settings: {  
> index.number\_of\_shards: "5",  
> index.number\_of\_replicas: "1",  
> index.version.created: "190399"  
> }  
> }  
> }
> 
> Questions: what am I doing wrong? Is there other ways to verify the  
> mappings are properly applied? I am using Java client.

On Tuesday, May 15, 2012 12:45:37 PM UTC-4, Helen Poon wrote:

> Here is my setup:
> 
> - index: "en"
> - type: "product"
> 
> the mapping file is at ES\_HOME/config/mappings/\_default/product.json  
> it contains:
> 
> {  
> "product" : {  
> "dynamic\_templates" : [  
> {  
> "template\_1" : {  
> "match" : "\*",  
> "match\_mapping\_type" : "string",  
> "mapping" : { "type" : "string", "omit\_norms" :  
> "yes", "store": "no", "index": "not\_analyzed"}  
> }  
> }  
> ],  
> "\_all" : {"enabled" : false},  
> "properties" : {  
> "pid" : {  
> "type" : "string",  
> "store" : "yes",  
> "index" : "not\_analyzed"  
> },  
> "rid" : {  
> "type" : "string",  
> "store" : "yes",  
> "index" : "not\_analyzed"  
> },  
> "pgrp" : {  
> "type" : "string",  
> "store" : "yes",  
> "index" : "not\_analyzed"  
> },  
> "descl" : {  
> "type" : "string",  
> "store" : "no",  
> "index" : "analyzed",  
> "boost" : 1.0  
> },  
> "descs" : {  
> "type" : "string",  
> "store" : "no",  
> "index" : "analyzed",  
> "boost" : 1.3  
> }  
> }}}
> 
> Index is created like:
> 
> ```
> node = NodeBuilder.nodeBuilder().data(true).node(); 
> client = node.client(); 
> 
> ```
> 
> client.admin().indices().prepareCreate("en").execute().actionGet();
> 
> And indexed like:
> 
> ```
> final IndexRequestBuilder irb = 
> 
> ```
> 
> client.prepareIndex(getIndexName(),  
> getIndexType(), p.getProductId()).setSource(b);  
> irb.execute().actionGet();
> 
> When I do a get, I get the following:
> 
> {  
> \_index: "en",  
> \_type: "product",  
> \_id: "58d2ccf1-abc6-4a61-9eca-7c4d342b48c8",  
> \_version: 2,  
> exists: true,  
> \_source: {  
> pid: "58d2ccf1-abc6-4a61-9eca-7c4d342b48c8",  
> rid: "44fe535f-4531-48bd-82d1-d96b6ef2bbe7",  
> descl: "The Way Home",  
> descs: "The Way Home"  
> }  
> }
> 
> I believe the mapping is not taking effect because "descl" & "descs"  
> have been defined as "store":"no". My understanding is that these  
> fields should not have been stored in the index and therefore should  
> not be returned.
> 
> "[http://localhost:9200/en/\_settings](http://localhost:9200/en/_settings)" returned following which also  
> indicate no mappings
> 
> {  
> en: {  
> settings: {  
> index.number\_of\_shards: "5",  
> index.number\_of\_replicas: "1",  
> index.version.created: "190399"  
> }  
> }  
> }
> 
> Questions: what am I doing wrong? Is there other ways to verify the  
> mappings are properly applied? I am using Java client.

---

<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:28am UTC](https://discuss.elastic.co/t/configd-mapping-does-not-seem-to-take-effect/7706/4 "2017-07-06T03:28:07Z")

</div>


