# Potential bug? Mapping seems to ignore store='no' and enabled: false

**URL:** <https://discuss.elastic.co/t/potential-bug-mapping-seems-to-ignore-store-no-and-enabled-false/6003>\
**Category:** Elasticsearch\
**Created:** [November 29, 2011, 3:05am UTC](https://discuss.elastic.co/t/potential-bug-mapping-seems-to-ignore-store-no-and-enabled-false/6003 "2011-11-29T03:05:55Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Tal\_Rotbart](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/tal_rotbart/32/2651_2.png) [@Tal\_Rotbart](https://discuss.elastic.co/u/Tal_Rotbart)\
**Post date:** [November 29, 2011, 3:05am UTC](https://discuss.elastic.co/t/potential-bug-mapping-seems-to-ignore-store-no-and-enabled-false/6003/1 "2011-11-29T03:05:55Z")

</div>

Hi all,

There seems to be an issue with ES ignoring "store" : "no" and  
"enabled": false.

I couldn't find any other information so I'm coming to the list. Tried  
different combinations using 'false' instead of no, etc.

Also, the result of a GET is the same whether "\_source" : { "enabled"  
: false } or "\_source" : { "enabled" : true }.

Search do appear different with "\_source" : { "enabled" : false } --  
but the GET still returns the full JSON...

Bash script to recreate is at gist: [https://gist.github.com/1403154](https://gist.github.com/1403154)

Any pointers or help would be greatly appreciated.

Cheers,  
Tal

---

<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:** [November 29, 2011, 7:14am UTC](https://discuss.elastic.co/t/potential-bug-mapping-seems-to-ignore-store-no-and-enabled-false/6003/2 "2011-11-29T07:14:12Z")

</div>

Its not really ignored, when you do a get, it might fetch the document from  
the transaction log, not the index storage itself, and there the document  
source exists regardless if you set enabled to false. But, the fact that  
its in the transaction log does not mean that we should return it in this  
case, since its confusing, will open an issue to no do it:  
[When \_source is disabled, don't return it in realtime get fetching the document from the transaction log · Issue #1509 · elastic/elasticsearch · GitHub](https://github.com/elasticsearch/elasticsearch/issues/1509).

Btw, what does store has to do with it?

On Tue, Nov 29, 2011 at 5:05 AM, Tal Rotbart [redbeard@gmail.com](mailto:redbeard@gmail.com) wrote:

> Hi all,
> 
> There seems to be an issue with ES ignoring "store" : "no" and  
> "enabled": false.
> 
> I couldn't find any other information so I'm coming to the list. Tried  
> different combinations using 'false' instead of no, etc.
> 
> Also, the result of a GET is the same whether "\_source" : { "enabled"  
> : false } or "\_source" : { "enabled" : true }.
> 
> Search do appear different with "\_source" : { "enabled" : false } --  
> but the GET still returns the full JSON...
> 
> Bash script to recreate is at gist: [Demonstrates a potential bug in elasticsearch's 'store' and 'enabled' mapping options · GitHub](https://gist.github.com/1403154)
> 
> Any pointers or help would be greatly appreciated.
> 
> Cheers,  
> Tal

---

<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:** [November 29, 2011, 7:20am UTC](https://discuss.elastic.co/t/potential-bug-mapping-seems-to-ignore-store-no-and-enabled-false/6003/3 "2011-11-29T07:20:00Z")

</div>

And btw, your gist have \_source enabled set to true.

On Tue, Nov 29, 2011 at 9:14 AM, Shay Banon [kimchy@gmail.com](mailto:kimchy@gmail.com) wrote:

> Its not really ignored, when you do a get, it might fetch the document  
> from the transaction log, not the index storage itself, and there the  
> document source exists regardless if you set enabled to false. But, the  
> fact that its in the transaction log does not mean that we should return it  
> in this case, since its confusing, will open an issue to no do it:  
> [When \_source is disabled, don't return it in realtime get fetching the document from the transaction log · Issue #1509 · elastic/elasticsearch · GitHub](https://github.com/elasticsearch/elasticsearch/issues/1509).
> 
> Btw, what does store has to do with it?
> 
> On Tue, Nov 29, 2011 at 5:05 AM, Tal Rotbart [redbeard@gmail.com](mailto:redbeard@gmail.com) wrote:
> 
> > Hi all,
> > 
> > There seems to be an issue with ES ignoring "store" : "no" and  
> > "enabled": false.
> > 
> > I couldn't find any other information so I'm coming to the list. Tried  
> > different combinations using 'false' instead of no, etc.
> > 
> > Also, the result of a GET is the same whether "\_source" : { "enabled"  
> > : false } or "\_source" : { "enabled" : true }.
> > 
> > Search do appear different with "\_source" : { "enabled" : false } --  
> > but the GET still returns the full JSON...
> > 
> > Bash script to recreate is at gist: [Demonstrates a potential bug in elasticsearch's 'store' and 'enabled' mapping options · GitHub](https://gist.github.com/1403154)
> > 
> > Any pointers or help would be greatly appreciated.
> > 
> > Cheers,  
> > Tal

---

<div class="post-metadata">

**Author:** ![Tal\_Rotbart](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/tal_rotbart/32/2651_2.png) [@Tal\_Rotbart](https://discuss.elastic.co/u/Tal_Rotbart)\
**Post date:** [November 29, 2011, 11:39pm UTC](https://discuss.elastic.co/t/potential-bug-mapping-seems-to-ignore-store-no-and-enabled-false/6003/4 "2011-11-29T23:39:32Z")

</div>

Thanks for the quick reply!

The transaction log explains the source being returned even with  
\_source disabled. I guess a clarification in the docs would do the  
trick.

Thanks to your comment about store, I've realised that I've been  
expecting ES to return the stored fields but I wasn't specifying  
'fields'.

It all comes down to indexing 3rd party JSON which I have little  
control over, I wanted to be able to avoid storing large amounts of  
data in the index so needed fine grained control over which fields I'm  
interested in storing and returning for view. Now I understand how to  
do it. Thanks!

Cheers,  
Tal

On 29 November 2011 18:20, Shay Banon [kimchy@gmail.com](mailto:kimchy@gmail.com) wrote:

> And btw, your gist have \_source enabled set to true.
> 
> On Tue, Nov 29, 2011 at 9:14 AM, Shay Banon [kimchy@gmail.com](mailto:kimchy@gmail.com) wrote:
> 
> > Its not really ignored, when you do a get, it might fetch the document  
> > from the transaction log, not the index storage itself, and there the  
> > document source exists regardless if you set enabled to false. But, the fact  
> > that its in the transaction log does not mean that we should return it in  
> > this case, since its confusing, will open an issue to no do  
> > it: [When \_source is disabled, don't return it in realtime get fetching the document from the transaction log · Issue #1509 · elastic/elasticsearch · GitHub](https://github.com/elasticsearch/elasticsearch/issues/1509).
> > 
> > Btw, what does store has to do with it?
> > 
> > On Tue, Nov 29, 2011 at 5:05 AM, Tal Rotbart [redbeard@gmail.com](mailto:redbeard@gmail.com) wrote:
> > 
> > > Hi all,
> > > 
> > > There seems to be an issue with ES ignoring "store" : "no" and  
> > > "enabled": false.
> > > 
> > > I couldn't find any other information so I'm coming to the list. Tried  
> > > different combinations using 'false' instead of no, etc.
> > > 
> > > Also, the result of a GET is the same whether "\_source" : { "enabled"  
> > > : false } or "\_source" : { "enabled" : true }.
> > > 
> > > Search do appear different with "\_source" : { "enabled" : false } --  
> > > but the GET still returns the full JSON...
> > > 
> > > Bash script to recreate is at gist: [Demonstrates a potential bug in elasticsearch's 'store' and 'enabled' mapping options · GitHub](https://gist.github.com/1403154)
> > > 
> > > Any pointers or help would be greatly appreciated.
> > > 
> > > Cheers,  
> > > Tal

---

<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:47am UTC](https://discuss.elastic.co/t/potential-bug-mapping-seems-to-ignore-store-no-and-enabled-false/6003/5 "2017-07-06T03:47:00Z")

</div>


