# Fields excluded from source still returned by GET api

**URL:** https://discuss.elastic.co/t/fields-excluded-from-source-still-returned-by-get-api/12489
**Category:** Elasticsearch
**Created:** [June 20, 2013, 7:56am UTC](https://discuss.elastic.co/t/fields-excluded-from-source-still-returned-by-get-api/12489 "2013-06-20T07:56:44Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![Allan\_Johns](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/allan_johns/32/2387_2.png) [@Allan\_Johns](https://discuss.elastic.co/u/Allan_Johns)
#### Post date: [June 20, 2013, 7:56am UTC](https://discuss.elastic.co/t/fields-excluded-from-source-still-returned-by-get-api/12489/1 "2013-06-20T07:56:44Z")

</div>

I have a mapping like so:

```
    "_source" : {
        "excludes" : [
            "_*"
        ]
    }

```

And using search API, it behaves as expected:

]$ curl -XGET '[http://gasdb:9200/fury/product/\_search?pretty=true&size=1](http://gasdb:9200/fury/product/_search?pretty=true&size=1)'  
{  
"\_score" : 1.0, "\_source" :  
{"folder":"/seq89/shot140/robot/377","timestamp":1371714409,"asset":"robot","name":"robot.#.dpx","path":"/jobs/fury/seq89/shot140/robot/v377/robot.\*.dpx","seq":"seq89","user":"bruce.lee","shot":"shot140","ext":"dpx","version":377}  
} ]  
}  
}

But using GET, I get back fields starting with underscores:

]$ curl -XGET '  
[http://gasdb:9200/fury/product/%2Fseq52%2Fshot428%2Ffern%2F854%2Ffern.%23.abc?pretty=true](http://gasdb:9200/fury/product/%2Fseq52%2Fshot428%2Ffern%2F854%2Ffern.%23.abc?pretty=true)  
'  
{  
"exists" : true, "\_source" : {"shot": "shot428", "name": "fern.#.abc",  
"seq": "seq52", "timestamp": 1371714412, "\_fldr\_1": "/seq52", "\_fldr\_3":  
"/seq52/shot428/fern", "\_fldr\_2": "/seq52/shot428", "ext": "abc",  
"version": 854, "user": "mr.satan", "\_fldr\_4": "/seq52/shot428/fern/854",  
"path": "/jobs/fury/seq52/shot428/fern/v854/fern.\*.abc", "folder":  
"/seq52/shot428/fern/854", "\_fields": "asset,ext,seq,shot,user", "asset":  
"fern"}

Is this intended behaviour? I expected my excluded fields to be excluded in  
all cases, not depending on get/search etc.

Thanks  
Allan

--  
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).  
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: [June 24, 2013, 2:20pm UTC](https://discuss.elastic.co/t/fields-excluded-from-source-still-returned-by-get-api/12489/2 "2013-06-24T14:20:30Z")

</div>

Hey,

what elasticsearch version do you use? There was an issue fixed in the  
current 0.90.1 with realtime GET and source excludes (not sure about 0.90  
right now). Can you retry with the latest version?

--Alex

On Thu, Jun 20, 2013 at 9:56 AM, Allan Johns [nerdvegas@gmail.com](mailto:nerdvegas@gmail.com) wrote:

> I have a mapping like so:
> 
> ```
> "_source" : {
> "excludes" : [
> "_*"
> ]
> }
> 
> ```
> 
> And using search API, it behaves as expected:
> 
> ]$ curl -XGET '[http://gasdb:9200/fury/product/\_search?pretty=true&size=1](http://gasdb:9200/fury/product/_search?pretty=true&size=1)'  
> {  
> "\_score" : 1.0, "\_source" :  
> {"folder":"/seq89/shot140/robot/377","timestamp":1371714409,"asset":"robot","name":"robot.#.dpx","path":"/jobs/fury/seq89/shot140/robot/v377/robot.\*.dpx","seq":"seq89","user":"bruce.lee","shot":"shot140","ext":"dpx","version":377}  
> } ]  
> }  
> }
> 
> But using GET, I get back fields starting with underscores:
> 
> ]$ curl -XGET '  
> [http://gasdb:9200/fury/product/%2Fseq52%2Fshot428%2Ffern%2F854%2Ffern.%23.abc?pretty=true](http://gasdb:9200/fury/product/%2Fseq52%2Fshot428%2Ffern%2F854%2Ffern.%23.abc?pretty=true)  
> '  
> {  
> "exists" : true, "\_source" : {"shot": "shot428", "name": "fern.#.abc",  
> "seq": "seq52", "timestamp": 1371714412, "\_fldr\_1": "/seq52", "\_fldr\_3":  
> "/seq52/shot428/fern", "\_fldr\_2": "/seq52/shot428", "ext": "abc",  
> "version": 854, "user": "mr.satan", "\_fldr\_4": "/seq52/shot428/fern/854",  
> "path": "/jobs/fury/seq52/shot428/fern/v854/fern.\*.abc", "folder":  
> "/seq52/shot428/fern/854", "\_fields": "asset,ext,seq,shot,user", "asset":  
> "fern"}
> 
> Is this intended behaviour? I expected my excluded fields to be excluded  
> in all cases, not depending on get/search etc.
> 
> Thanks  
> Allan
> 
> --  
> 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).  
> 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).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<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, 2:29am UTC](https://discuss.elastic.co/t/fields-excluded-from-source-still-returned-by-get-api/12489/3 "2017-07-06T02:29:45Z")

</div>


