# Include\_in\_all: false not working for nested multi-field mappings in default-mapping.json

**URL:** <https://discuss.elastic.co/t/include-in-all-false-not-working-for-nested-multi-field-mappings-in-default-mapping-json/16207>\
**Category:** Elasticsearch\
**Created:** [March 6, 2014, 8:40pm UTC](https://discuss.elastic.co/t/include-in-all-false-not-working-for-nested-multi-field-mappings-in-default-mapping-json/16207 "2014-03-06T20:40:26Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![asanderson](https://avatars.discourse-cdn.com/v4/letter/a/8e8cbc/32.png) [@asanderson](https://discuss.elastic.co/u/asanderson)\
**Post date:** [March 6, 2014, 8:40pm UTC](https://discuss.elastic.co/t/include-in-all-false-not-working-for-nested-multi-field-mappings-in-default-mapping-json/16207/1 "2014-03-06T20:40:26Z")

</div>

I'm running Elasticsearch 1.0.1 using the following  
$ES\_HOME/config/default-mapping.json:  
{  
"\_default": {  
"properties": {  
"foo": {  
"type": "nested",  
"include\_in\_all": false,  
"properties": {  
"bar": {  
"type": "string",  
"index": "not\_analyzed",  
"include\_in\_all": false,  
"fields": {  
"lower": {  
"analyzer": "lowercase",  
"type": "string"  
}  
}  
}  
}  
}  
}  
}  
}

When i post the following, the include\_in\_all does not seem to be  
recognized at any level:  
{  
"foo": {  
"bar": "Elasticsearch rules!"  
}  
}

The resulting index metadata is the following:  
{  
state: open  
settings: {  
index: {  
uuid: TJf\_oVKLSzuGD1q8xWq9nw  
number\_of\_replicas: 0  
number\_of\_shards: 1  
version: {  
created: 1000199  
}  
}  
}  
mappings: {  
foobar: {  
properties: {  
foo: {  
properties: {  
bar: {  
type: string  
}  
}  
}  
}  
}  
}  
aliases: []  
}

I verified that \_all does include the "elasticsearch rules" via the  
following aggregation search:  
{  
"aggs": {  
"foobar": {  
"terms": {  
"field": "\_all"  
}  
}  
},  
"size": 0  
}

The aggregation results are the following:  
{  
took: 25  
timed\_out: false  
\_shards: {  
total: 1  
successful: 1  
failed: 0  
}  
hits: {  
total: 1  
max\_score: 0  
hits: []  
}  
aggregations: {  
foo: {  
buckets: [  
{  
key: elasticsearch  
doc\_count: 1  
}  
{  
key: rules  
doc\_count: 1  
}  
]  
}  
}  
}

Any idea what I'm doing wrong, or is this a bug?

--  
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/54564669-d69c-48a9-85b5-a0a9c8162ff7%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/54564669-d69c-48a9-85b5-a0a9c8162ff7%40googlegroups.com).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<div class="post-metadata">

**Author:** ![spinscale](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/spinscale/32/25011_2.png) [@spinscale](https://discuss.elastic.co/u/spinscale)\
**Post date:** [March 7, 2014, 8:21am UTC](https://discuss.elastic.co/t/include-in-all-false-not-working-for-nested-multi-field-mappings-in-default-mapping-json/16207/2 "2014-03-07T08:21:26Z")

</div>

Hey,

must be _default_, not \_default as shown in your default-mapping.json

--Alex

On Thu, Mar 6, 2014 at 9:40 PM, asanderson [a.steven.anderson@gmail.com](mailto:a.steven.anderson@gmail.com)wrote:

> I'm running Elasticsearch 1.0.1 using the following  
> $ES\_HOME/config/default-mapping.json:  
> {  
> "\_default": {  
> "properties": {  
> "foo": {  
> "type": "nested",  
> "include\_in\_all": false,  
> "properties": {  
> "bar": {  
> "type": "string",  
> "index": "not\_analyzed",  
> "include\_in\_all": false,  
> "fields": {  
> "lower": {  
> "analyzer": "lowercase",  
> "type": "string"  
> }  
> }  
> }  
> }  
> }  
> }  
> }  
> }
> 
> When i post the following, the include\_in\_all does not seem to be  
> recognized at any level:  
> {  
> "foo": {  
> "bar": "Elasticsearch rules!"  
> }  
> }
> 
> The resulting index metadata is the following:  
> {  
> state: open  
> settings: {  
> index: {  
> uuid: TJf\_oVKLSzuGD1q8xWq9nw  
> number\_of\_replicas: 0  
> number\_of\_shards: 1  
> version: {  
> created: 1000199  
> }  
> }  
> }  
> mappings: {  
> foobar: {  
> properties: {  
> foo: {  
> properties: {  
> bar: {  
> type: string  
> }  
> }  
> }  
> }  
> }  
> }  
> aliases:   
> }
> 
> I verified that \_all does include the "elasticsearch rules" via the  
> following aggregation search:  
> {  
> "aggs": {  
> "foobar": {  
> "terms": {  
> "field": "\_all"  
> }  
> }  
> },  
> "size": 0  
> }
> 
> The aggregation results are the following:  
> {  
> took: 25  
> timed\_out: false  
> \_shards: {  
> total: 1  
> successful: 1  
> failed: 0  
> }  
> hits: {  
> total: 1  
> max\_score: 0  
> hits:   
> }  
> aggregations: {  
> foo: {  
> buckets: [  
> {  
> key: elasticsearch  
> doc\_count: 1  
> }  
> {  
> key: rules  
> doc\_count: 1  
> }  
> ]  
> }  
> }  
> }
> 
> Any idea what I'm doing wrong, or is this a bug?
> 
> --  
> 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/54564669-d69c-48a9-85b5-a0a9c8162ff7%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/54564669-d69c-48a9-85b5-a0a9c8162ff7%40googlegroups.com)[https://groups.google.com/d/msgid/elasticsearch/54564669-d69c-48a9-85b5-a0a9c8162ff7%40googlegroups.com?utm\_medium=email&utm\_source=footer](https://groups.google.com/d/msgid/elasticsearch/54564669-d69c-48a9-85b5-a0a9c8162ff7%40googlegroups.com?utm_medium=email&utm_source=footer)  
> .  
> For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

--  
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/CAGCwEM\_qJPi6hsqwhVAZHX9pDA9xk23HsoXvR6bAn1Yvh\_ab-w%40mail.gmail.com](https://groups.google.com/d/msgid/elasticsearch/CAGCwEM_qJPi6hsqwhVAZHX9pDA9xk23HsoXvR6bAn1Yvh_ab-w%40mail.gmail.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<div class="post-metadata">

**Author:** ![asanderson](https://avatars.discourse-cdn.com/v4/letter/a/8e8cbc/32.png) [@asanderson](https://discuss.elastic.co/u/asanderson)\
**Post date:** [March 7, 2014, 4:11pm UTC](https://discuss.elastic.co/t/include-in-all-false-not-working-for-nested-multi-field-mappings-in-default-mapping-json/16207/3 "2014-03-07T16:11:57Z")

</div>

> must be _default_, not \_default as shown in your default-mapping.json

Ahhh...good catch. That was a typo. However, after fixing that typo, the  
problem remains.

The aggs search result is the following:  
{  
took: 36  
timed\_out: false  
\_shards: {  
total: 1  
successful: 1  
failed: 0  
}  
hits: {  
total: 1  
max\_score: 0  
hits:   
}  
aggregations: {  
foo: {  
buckets: [  
{  
key: elasticsearch  
doc\_count: 1  
}  
{  
key: rule  
doc\_count: 1  
}  
]  
}  
}  
}

My revised default-mapping.json is the following (I also changed an  
analyzer):  
{  
"_default_": {  
"properties": {  
"foo": {  
"type": "nested",  
"include\_in\_all": false,  
"properties": {  
"bar": {  
"type": "string",  
"index": "not\_analyzed",  
"include\_in\_all": false,  
"fields": {  
"lower": {  
"analyzer": "standard",  
"type": "string"  
}  
}  
}  
}  
}  
}  
}  
}

The resulting metadata is the following:  
{  
state: open  
settings: {  
index: {  
uuid: S2hmo2d3SGWFP51PXs6XbA  
number\_of\_replicas: 0  
number\_of\_shards: 1  
version: {  
created: 1000199  
}  
}  
}  
mappings: {  
foobar: {  
properties: {  
foo: {  
include\_in\_all: false  
properties: {  
bar: {  
include\_in\_all: false  
index: not\_analyzed  
type: string  
fields: {  
lower: {  
analyzer: standard  
type: string  
}  
}  
}  
}  
type: nested  
}  
}  
}  
}  
aliases:   
}

So, is this a bug?

--  
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/e0dac3e7-d825-41d8-bb35-ab33ef8c7290%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/e0dac3e7-d825-41d8-bb35-ab33ef8c7290%40googlegroups.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:44am UTC](https://discuss.elastic.co/t/include-in-all-false-not-working-for-nested-multi-field-mappings-in-default-mapping-json/16207/4 "2017-07-06T01:44:52Z")

</div>


