# Unable to disable the \_source field

**URL:** <https://discuss.elastic.co/t/unable-to-disable-the--source-field/3145>\
**Category:** Elasticsearch\
**Created:** [July 24, 2010, 12:18pm UTC](https://discuss.elastic.co/t/unable-to-disable-the--source-field/3145 "2010-07-24T12:18:44Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![Sergio\_Bossa](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/sergio_bossa/32/3312_2.png) [@Sergio\_Bossa](https://discuss.elastic.co/u/Sergio_Bossa)\
**Post date:** [July 24, 2010, 12:18pm UTC](https://discuss.elastic.co/t/unable-to-disable-the--source-field/3145/1 "2010-07-24T12:18:44Z")

</div>

Hi,

I tried to disable the \_source field by modifying the dynamic mapping.  
I changed the dynamic mapping location by setting the  
index.mapper.dynamicMappingLocation property, and created the  
following json mapping configuration:

{  
"_default_" : {  
"\_source" : {"enabled" : false}  
}  
}

Too bad, I still get the \_source field in search results.

Am I missing something?  
Thanks!

Sergio B.

--  
Sergio Bossa  
[http://www.linkedin.com/in/sergiob](http://www.linkedin.com/in/sergiob)

---

<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 25, 2010, 8:48am UTC](https://discuss.elastic.co/t/unable-to-disable-the--source-field/3145/2 "2010-07-25T08:48:56Z")

</div>

This looks like a bug. I will have a look at this.

-shay.banon

On Sat, Jul 24, 2010 at 3:18 PM, Sergio Bossa [sergio.bossa@gmail.com](mailto:sergio.bossa@gmail.com)wrote:

> Hi,
> 
> I tried to disable the \_source field by modifying the dynamic mapping.  
> I changed the dynamic mapping location by setting the  
> index.mapper.dynamicMappingLocation property, and created the  
> following json mapping configuration:
> 
> {  
> "_default_" : {  
> "\_source" : {"enabled" : false}  
> }  
> }
> 
> Too bad, I still get the \_source field in search results.
> 
> Am I missing something?  
> Thanks!
> 
> Sergio B.
> 
> --  
> Sergio Bossa  
> [http://www.linkedin.com/in/sergiob](http://www.linkedin.com/in/sergiob)

---

<div class="post-metadata">

**Author:** ![Sergio\_Bossa](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/sergio_bossa/32/3312_2.png) [@Sergio\_Bossa](https://discuss.elastic.co/u/Sergio_Bossa)\
**Post date:** [July 25, 2010, 8:53am UTC](https://discuss.elastic.co/t/unable-to-disable-the--source-field/3145/3 "2010-07-25T08:53:34Z")

</div>

On Sun, Jul 25, 2010 at 10:48 AM, Shay Banon  
[shay.banon@elasticsearch.com](mailto:shay.banon@elasticsearch.com) wrote:

> This looks like a bug. I will have a look at this.

Great. Thanks.

--  
Sergio Bossa  
[http://www.linkedin.com/in/sergiob](http://www.linkedin.com/in/sergiob)

---

<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 25, 2010, 9:18am UTC](https://discuss.elastic.co/t/unable-to-disable-the--source-field/3145/4 "2010-07-25T09:18:02Z")

</div>

Opened a case for this:  
[Mapping: Dynamic mapping definitions are ignored · Issue #274 · elastic/elasticsearch · GitHub](http://github.com/elasticsearch/elasticsearch/issues/issue/274), will push a  
fix later today. What I would really want to have is the _default_ mapping  
to form the basis for any mapping definition, so even when you put a  
mapping, it will be used as well (unless explicitly overridden in the put  
mapping definition).

-shay.banon

On Sun, Jul 25, 2010 at 11:53 AM, Sergio Bossa [sergio.bossa@gmail.com](mailto:sergio.bossa@gmail.com)wrote:

> On Sun, Jul 25, 2010 at 10:48 AM, Shay Banon  
> [shay.banon@elasticsearch.com](mailto:shay.banon@elasticsearch.com) wrote:
> 
> > This looks like a bug. I will have a look at this.
> 
> Great. Thanks.
> 
> --  
> Sergio Bossa  
> [http://www.linkedin.com/in/sergiob](http://www.linkedin.com/in/sergiob)

---

<div class="post-metadata">

**Author:** ![Sergio\_Bossa](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/sergio_bossa/32/3312_2.png) [@Sergio\_Bossa](https://discuss.elastic.co/u/Sergio_Bossa)\
**Post date:** [July 25, 2010, 9:29am UTC](https://discuss.elastic.co/t/unable-to-disable-the--source-field/3145/5 "2010-07-25T09:29:17Z")

</div>

On Sun, Jul 25, 2010 at 11:18 AM, Shay Banon  
[shay.banon@elasticsearch.com](mailto:shay.banon@elasticsearch.com) wrote:

> Opened a case for  
> this: [Mapping: Dynamic mapping definitions are ignored · Issue #274 · elastic/elasticsearch · GitHub](http://github.com/elasticsearch/elasticsearch/issues/issue/274), will  
> push a fix later today.

Great: I'll give it a try as soon as available.

> What I would really want to have is the _default_  
> mapping to form the basis for any mapping definition, so even when you put a  
> mapping, it will be used as well (unless explicitly overridden in the put  
> mapping definition).

Absolutely agree.

Cheers,

Sergio B.

--  
Sergio Bossa  
[http://www.linkedin.com/in/sergiob](http://www.linkedin.com/in/sergiob)

---

<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 25, 2010, 9:38pm UTC](https://discuss.elastic.co/t/unable-to-disable-the--source-field/3145/6 "2010-07-25T21:38:35Z")

</div>

Managed to get this into upcoming 0.9 (with a breaking change):  
[Issues · elastic/elasticsearch · GitHub](http://github.com/elasticsearch/elasticsearch/issues/closed#issue/275).

-shay.banon

On Sun, Jul 25, 2010 at 12:29 PM, Sergio Bossa [sergio.bossa@gmail.com](mailto:sergio.bossa@gmail.com)wrote:

> On Sun, Jul 25, 2010 at 11:18 AM, Shay Banon  
> [shay.banon@elasticsearch.com](mailto:shay.banon@elasticsearch.com) wrote:
> 
> > Opened a case for  
> > this: [Mapping: Dynamic mapping definitions are ignored · Issue #274 · elastic/elasticsearch · GitHub](http://github.com/elasticsearch/elasticsearch/issues/issue/274),  
> > will  
> > push a fix later today.
> 
> Great: I'll give it a try as soon as available.
> 
> > What I would really want to have is the _default_  
> > mapping to form the basis for any mapping definition, so even when you  
> > put a  
> > mapping, it will be used as well (unless explicitly overridden in the put  
> > mapping definition).
> 
> Absolutely agree.
> 
> Cheers,
> 
> Sergio B.
> 
> --  
> Sergio Bossa  
> [http://www.linkedin.com/in/sergiob](http://www.linkedin.com/in/sergiob)

---

<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:21am UTC](https://discuss.elastic.co/t/unable-to-disable-the--source-field/3145/7 "2017-07-06T04:21:40Z")

</div>


