# How to retrieve specific \_source inner fields

**URL:** <https://discuss.elastic.co/t/how-to-retrieve-specific--source-inner-fields/3894>\
**Category:** Elasticsearch\
**Created:** [February 7, 2011, 12:23pm UTC](https://discuss.elastic.co/t/how-to-retrieve-specific--source-inner-fields/3894 "2011-02-07T12:23:04Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![Giles\_Velarde](https://avatars.discourse-cdn.com/v4/letter/g/8491ac/32.png) [@Giles\_Velarde](https://discuss.elastic.co/u/Giles_Velarde)\
**Post date:** [February 7, 2011, 12:23pm UTC](https://discuss.elastic.co/t/how-to-retrieve-specific--source-inner-fields/3894/1 "2011-02-07T12:23:04Z")

</div>

Hi,

I am trying to understand how to select the name of the fields to  
return. I have read around but could not find an example for this,  
though I have seen that it is a recent feature ([https://github.com/](https://github.com/)  
elasticsearch/elasticsearch/issues/issue/562).

For example I have a document :

[http://localhost:9200/features/Feature/PFA0005w:pep](http://localhost:9200/features/Feature/PFA0005w:pep)  
{  
\_index: "features",  
\_type: "Feature",  
\_id: "PFA0005w:pep",  
\_source: {  
uniqueName: "PFA0005w:pep"  
...  
coordinates: [  
{  
region: "Pf3D7\_01",  
fmin: 29733,  
fmax: 37349,  
phase: null,  
strand: 0,  
}  
],  
...  
}  
}

For which I would like to pull only its coordinates array. If I try :

[http://localhost:9200/features/Feature/PFA0005w:pep?fields=\_source.coordinates](http://localhost:9200/features/Feature/PFA0005w:pep?fields=_source.coordinates)  
{  
error: "ElasticSearchException[No mapping for field  
[\_source.coordinates] in type [Feature]]"  
}

Any help constructing the right request would be most appreciated.

Best, Giles.

---

<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:** [February 7, 2011, 6:25pm UTC](https://discuss.elastic.co/t/how-to-retrieve-specific--source-inner-fields/3894/2 "2011-02-07T18:25:27Z")

</div>

This was fixed in master. Can you give it a whirl?  
On Monday, February 7, 2011 at 2:23 PM, Giles Velarde wrote:

> Hi,
> 
> I am trying to understand how to select the name of the fields to  
> return. I have read around but could not find an example for this,  
> though I have seen that it is a recent feature ([https://github.com/](https://github.com/)  
> elasticsearch/elasticsearch/issues/issue/562).
> 
> For example I have a document :
> 
> [http://localhost:9200/features/Feature/PFA0005w:pep](http://localhost:9200/features/Feature/PFA0005w:pep)  
> {  
> \_index: "features",  
> \_type: "Feature",  
> \_id: "PFA0005w:pep",  
> \_source: {  
> uniqueName: "PFA0005w:pep"  
> ...  
> coordinates: [  
> {  
> region: "Pf3D7\_01",  
> fmin: 29733,  
> fmax: 37349,  
> phase: null,  
> strand: 0,  
> }  
> ],  
> ...  
> }  
> }
> 
> For which I would like to pull only its coordinates array. If I try :
> 
> [http://localhost:9200/features/Feature/PFA0005w:pep?fields=\_source.coordinates](http://localhost:9200/features/Feature/PFA0005w:pep?fields=_source.coordinates)  
> {  
> error: "ElasticSearchException[No mapping for field  
> [\_source.coordinates] in type [Feature]]"  
> }
> 
> Any help constructing the right request would be most appreciated.
> 
> Best, Giles.

---

<div class="post-metadata">

**Author:** ![Giles\_Velarde](https://avatars.discourse-cdn.com/v4/letter/g/8491ac/32.png) [@Giles\_Velarde](https://discuss.elastic.co/u/Giles_Velarde)\
**Post date:** [February 7, 2011, 7:48pm UTC](https://discuss.elastic.co/t/how-to-retrieve-specific--source-inner-fields/3894/3 "2011-02-07T19:48:54Z")

</div>

Happy to! Thanks!

On 7 February 2011 18:25, Shay Banon [shay.banon@elasticsearch.com](mailto:shay.banon@elasticsearch.com) wrote:

> This was fixed in master. Can you give it a whirl?
> 
> On Monday, February 7, 2011 at 2:23 PM, Giles Velarde wrote:
> 
> Hi,
> 
> I am trying to understand how to select the name of the fields to  
> return. I have read around but could not find an example for this,  
> though I have seen that it is a recent feature ([https://github.com/](https://github.com/)  
> elasticsearch/elasticsearch/issues/issue/562).
> 
> For example I have a document :
> 
> [http://localhost:9200/features/Feature/PFA0005w:pep](http://localhost:9200/features/Feature/PFA0005w:pep)  
> {  
> \_index: "features",  
> \_type: "Feature",  
> \_id: "PFA0005w:pep",  
> \_source: {  
> uniqueName: ""PFA0005w:pep"  
> ...  
> coordinates: [  
> {  
> region: "Pf3D7\_01",  
> fmin: 29733,  
> fmax: 37349,  
> phase: null,  
> strand: 0,  
> }}  
> ],  
> ...  
> }}  
> }
> 
> For which I would like to pull only its coordinates array. If I try :
> 
> [http://localhost:9200/features/Feature/PFA0005w:pep?fields=\_source.coordinates](http://localhost:9200/features/Feature/PFA0005w:pep?fields=_source.coordinates)  
> {  
> error: "ElasticSearchException[No mapping for field  
> [\_source.coordinates] in type [Feature]]"  
> }
> 
> Any help constructing the right request would be most appreciated.
> 
> Best, Giles.

---

<div class="post-metadata">

**Author:** ![Giles\_Velarde](https://avatars.discourse-cdn.com/v4/letter/g/8491ac/32.png) [@Giles\_Velarde](https://discuss.elastic.co/u/Giles_Velarde)\
**Post date:** [February 8, 2011, 11:36am UTC](https://discuss.elastic.co/t/how-to-retrieve-specific--source-inner-fields/3894/4 "2011-02-08T11:36:02Z")

</div>

I have just tried it on the master, same result unfortunately. I attach the  
log output and screenshots of the different requests.

Best, Giles.

On 7 February 2011 19:48, Giles Velarde [giles.velarde@gmail.com](mailto:giles.velarde@gmail.com) wrote:

> Happy to! Thanks!
> 
> On 7 February 2011 18:25, Shay Banon [shay.banon@elasticsearch.com](mailto:shay.banon@elasticsearch.com) wrote:
> 
> > This was fixed in master. Can you give it a whirl?
> > 
> > On Monday, February 7, 2011 at 2:23 PM, Giles Velarde wrote:
> > 
> > Hi,
> > 
> > I am trying to understand how to select the name of the fields to  
> > return. I have read around but could not find an example for this,  
> > though I have seen that it is a recent feature ([https://github.com/](https://github.com/)  
> > elasticsearch/elasticsearch/issues/issue/562).
> > 
> > For example I have a document :
> > 
> > [http://localhost:9200/features/Feature/PFA0005w:pep](http://localhost:9200/features/Feature/PFA0005w:pep)  
> > {  
> > \_index: "features",  
> > \_type: "Feature",  
> > \_id: "PFA0005w:pep",  
> > \_source: {  
> > uniqueName: ""PFA0005w:pep"  
> > ...  
> > coordinates: [  
> > {  
> > region: "Pf3D7\_01",  
> > fmin: 29733,  
> > fmax: 37349,  
> > phase: null,  
> > strand: 0,  
> > }}  
> > ],  
> > ...  
> > }}  
> > }
> > 
> > For which I would like to pull only its coordinates array. If I try :
> > 
> > [http://localhost:9200/features/Feature/PFA0005w:pep?fields=\_source.coordinates](http://localhost:9200/features/Feature/PFA0005w:pep?fields=_source.coordinates)  
> > {  
> > error: "ElasticSearchException[No mapping for field  
> > [\_source.coordinates] in type [Feature]]"  
> > }
> > 
> > Any help constructing the right request would be most appreciated.
> > 
> > Best, Giles.

---

<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:** [February 8, 2011, 2:18pm UTC](https://discuss.elastic.co/t/how-to-retrieve-specific--source-inner-fields/3894/5 "2011-02-08T14:18:42Z")

</div>

Can you just gist a curl recreation?  
On Tuesday, February 8, 2011 at 1:36 PM, Giles Velarde wrote:

> I have just tried it on the master, same result unfortunately. I attach the log output and screenshots of the different requests.
> 
> Best, Giles.
> 
> On 7 February 2011 19:48, Giles Velarde [giles.velarde@gmail.com](mailto:giles.velarde@gmail.com) wrote:
> 
> > Happy to! Thanks!
> > 
> > On 7 February 2011 18:25, Shay Banon [shay.banon@elasticsearch.com](mailto:shay.banon@elasticsearch.com) wrote:
> > 
> > > This was fixed in master. Can you give it a whirl?  
> > > On Monday, February 7, 2011 at 2:23 PM, Giles Velarde wrote:
> > > 
> > > > Hi,
> > > > 
> > > > I am trying to understand how to select the name of the fields to  
> > > > return. I have read around but could not find an example for this,  
> > > > though I have seen that it is a recent feature ([https://github.com/](https://github.com/)  
> > > > elasticsearch/elasticsearch/issues/issue/562).
> > > > 
> > > > For example I have a document :
> > > > 
> > > > [http://localhost:9200/features/Feature/PFA0005w:pep](http://localhost:9200/features/Feature/PFA0005w:pep)  
> > > > {  
> > > > \_index: "features",  
> > > > \_type: "Feature",  
> > > > \_id: "PFA0005w:pep",  
> > > > \_source: {  
> > > > uniqueName: ""PFA0005w:pep"  
> > > > ...  
> > > > coordinates: [  
> > > > {  
> > > > region: "Pf3D7\_01",  
> > > > fmin: 29733,  
> > > > fmax: 37349,  
> > > > phase: null,  
> > > > strand: 0,  
> > > > }}  
> > > > ],  
> > > > ...  
> > > > }}  
> > > > }
> > > > 
> > > > For which I would like to pull only its coordinates array. If I try :
> > > > 
> > > > [http://localhost:9200/features/Feature/PFA0005w:pep?fields=\_source.coordinates](http://localhost:9200/features/Feature/PFA0005w:pep?fields=_source.coordinates)  
> > > > {  
> > > > error: "ElasticSearchException[No mapping for field  
> > > > [\_source.coordinates] in type [Feature]]"  
> > > > }
> > > > 
> > > > Any help constructing the right request would be most appreciated.
> > > > 
> > > > Best, Giles.
> 
> Attachments:
> 
> - logfile.txt
> 
> - 1 complete entry.png
> 
> - 3 mapping.png
> 
> - 2 requesting coordinates field.png

---

<div class="post-metadata">

**Author:** ![Giles\_Velarde](https://avatars.discourse-cdn.com/v4/letter/g/8491ac/32.png) [@Giles\_Velarde](https://discuss.elastic.co/u/Giles_Velarde)\
**Post date:** [February 8, 2011, 3:24pm UTC](https://discuss.elastic.co/t/how-to-retrieve-specific--source-inner-fields/3894/6 "2011-02-08T15:24:52Z")

</div>

Done : [how to retrieve specific \_source inner fields · GitHub](https://gist.github.com/816572)

Best, Giles.

On 8 February 2011 14:18, Shay Banon [shay.banon@elasticsearch.com](mailto:shay.banon@elasticsearch.com) wrote:

> Can you just gist a curl recreation?
> 
> On Tuesday, February 8, 2011 at 1:36 PM, Giles Velarde wrote:
> 
> I have just tried it on the master, same result unfortunately. I attach the  
> log output and screenshots of the different requests.
> 
> Best, Giles.
> 
> On 7 February 2011 19:48, Giles Velarde [giles.velarde@gmail.com](mailto:giles.velarde@gmail.com) wrote:
> 
> Happy to! Thanks!
> 
> On 7 February 2011 18:25, Shay Banon [shay.banon@elasticsearch.com](mailto:shay.banon@elasticsearch.com) wrote:
> 
> This was fixed in master. Can you give it a whirl?
> 
> On Monday, February 7, 2011 at 2:23 PM, Giles Velarde wrote:
> 
> Hi,
> 
> I am trying to understand how to select the name of the fields to  
> return. I have read around but could not find an example for this,  
> though I have seen that it is a recent feature ([https://github.com/](https://github.com/)  
> elasticsearch/elasticsearch/issues/issue/562).
> 
> For example I have a document :
> 
> [http://localhost:9200/features/Feature/PFA0005w:pep](http://localhost:9200/features/Feature/PFA0005w:pep)  
> {  
> \_index: "features",  
> \_type: "Feature",  
> \_id: "PFA0005w:pep",  
> \_source: {  
> uniqueName: ""PFA0005w:pep"  
> ...  
> coordinates: [  
> {  
> region: "Pf3D7\_01",  
> fmin: 29733,  
> fmax: 37349,  
> phase: null,  
> strand: 0,  
> }}  
> ],  
> ...  
> }}  
> }
> 
> For which I would like to pull only its coordinates array. If I try :
> 
> [http://localhost:9200/features/Feature/PFA0005w:pep?fields=\_source.coordinates](http://localhost:9200/features/Feature/PFA0005w:pep?fields=_source.coordinates)  
> {  
> error: "ElasticSearchException[No mapping for field  
> [\_source.coordinates] in type [Feature]]"  
> }
> 
> Any help constructing the right request would be most appreciated.
> 
> Best, Giles.
> 
> Attachments:
> 
> - logfile.txt
> - 1 complete entry.png
> - 3 mapping.png
> - 2 requesting coordinates field.png

---

<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:** [February 8, 2011, 3:30pm UTC](https://discuss.elastic.co/t/how-to-retrieve-specific--source-inner-fields/3894/7 "2011-02-08T15:30:36Z")

</div>

Now I understand what happens. You use GET (which I missed) and not search. This feature is not enabled for get (getting by source fields), you can open an issue for this.  
On Tuesday, February 8, 2011 at 5:24 PM, Giles Velarde wrote:

> Done : [how to retrieve specific \_source inner fields · GitHub](https://gist.github.com/816572)
> 
> Best, Giles.
> 
> On 8 February 2011 14:18, Shay Banon [shay.banon@elasticsearch.com](mailto:shay.banon@elasticsearch.com) wrote:
> 
> > Can you just gist a curl recreation?  
> > On Tuesday, February 8, 2011 at 1:36 PM, Giles Velarde wrote:
> > 
> > > I have just tried it on the master, same result unfortunately. I attach the log output and screenshots of the different requests.
> > > 
> > > Best, Giles.
> > > 
> > > On 7 February 2011 19:48, Giles Velarde [giles.velarde@gmail.com](mailto:giles.velarde@gmail.com) wrote:
> > > 
> > > > Happy to! Thanks!
> > > > 
> > > > On 7 February 2011 18:25, Shay Banon [shay.banon@elasticsearch.com](mailto:shay.banon@elasticsearch.com) wrote:
> > > > 
> > > > > This was fixed in master. Can you give it a whirl?  
> > > > > On Monday, February 7, 2011 at 2:23 PM, Giles Velarde wrote:
> > > > > 
> > > > > > Hi,
> > > > > > 
> > > > > > I am trying to understand how to select the name of the fields to  
> > > > > > return. I have read around but could not find an example for this,  
> > > > > > though I have seen that it is a recent feature ([https://github.com/](https://github.com/)  
> > > > > > elasticsearch/elasticsearch/issues/issue/562).
> > > > > > 
> > > > > > For example I have a document :
> > > > > > 
> > > > > > [http://localhost:9200/features/Feature/PFA0005w:pep](http://localhost:9200/features/Feature/PFA0005w:pep)  
> > > > > > {  
> > > > > > \_index: "features",  
> > > > > > \_type: "Feature",  
> > > > > > \_id: "PFA0005w:pep",  
> > > > > > \_source: {  
> > > > > > uniqueName: ""PFA0005w:pep"  
> > > > > > ...  
> > > > > > coordinates: [  
> > > > > > {  
> > > > > > region: "Pf3D7\_01",  
> > > > > > fmin: 29733,  
> > > > > > fmax: 37349,  
> > > > > > phase: null,  
> > > > > > strand: 0,  
> > > > > > }}  
> > > > > > ],  
> > > > > > ...  
> > > > > > }}  
> > > > > > }
> > > > > > 
> > > > > > For which I would like to pull only its coordinates array. If I try :
> > > > > > 
> > > > > > [http://localhost:9200/features/Feature/PFA0005w:pep?fields=\_source.coordinates](http://localhost:9200/features/Feature/PFA0005w:pep?fields=_source.coordinates)  
> > > > > > {  
> > > > > > error: "ElasticSearchException[No mapping for field  
> > > > > > [\_source.coordinates] in type [Feature]]"  
> > > > > > }
> > > > > > 
> > > > > > Any help constructing the right request would be most appreciated.
> > > > > > 
> > > > > > Best, Giles.
> > > 
> > > Attachments:
> > > 
> > > - logfile.txt
> > > 
> > > - 1 complete entry.png
> > > 
> > > - 3 mapping.png
> > > 
> > > - 2 requesting coordinates field.png

---

<div class="post-metadata">

**Author:** ![Giles\_Velarde](https://avatars.discourse-cdn.com/v4/letter/g/8491ac/32.png) [@Giles\_Velarde](https://discuss.elastic.co/u/Giles_Velarde)\
**Post date:** [February 8, 2011, 3:49pm UTC](https://discuss.elastic.co/t/how-to-retrieve-specific--source-inner-fields/3894/8 "2011-02-08T15:49:11Z")

</div>

Done: [retrieving inner fields of \_source does not work in a get · Issue #677 · elastic/elasticsearch · GitHub](https://github.com/elasticsearch/elasticsearch/issues/issue/677)

Best, Giles.

On 8 February 2011 15:30, Shay Banon [shay.banon@elasticsearch.com](mailto:shay.banon@elasticsearch.com) wrote:

> Now I understand what happens. You use GET (which I missed) and not  
> search. This feature is not enabled for get (getting by source fields), you  
> can open an issue for this.
> 
> On Tuesday, February 8, 2011 at 5:24 PM, Giles Velarde wrote:
> 
> Done : [how to retrieve specific \_source inner fields · GitHub](https://gist.github.com/816572)
> 
> Best, Giles.
> 
> On 8 February 2011 14:18, Shay Banon [shay.banon@elasticsearch.com](mailto:shay.banon@elasticsearch.com) wrote:
> 
> > Can you just gist a curl recreation?
> > 
> > On Tuesday, February 8, 2011 at 1:36 PM, Giles Velarde wrote:
> > 
> > I have just tried it on the master, same result unfortunately. I attach  
> > the log output and screenshots of the different requests.
> > 
> > Best, Giles.
> > 
> > On 7 February 2011 19:48, Giles Velarde [giles.velarde@gmail.com](mailto:giles.velarde@gmail.com) wrote:
> > 
> > Happy to! Thanks!
> > 
> > On 7 February 2011 18:25, Shay Banon [shay.banon@elasticsearch.com](mailto:shay.banon@elasticsearch.com)wrote:
> > 
> > This was fixed in master. Can you give it a whirl?
> > 
> > On Monday, February 7, 2011 at 2:23 PM, Giles Velarde wrote:
> > 
> > Hi,
> > 
> > I am trying to understand how to select the name of the fields to  
> > return. I have read around but could not find an example for this,  
> > though I have seen that it is a recent feature ([https://github.com/](https://github.com/)  
> > elasticsearch/elasticsearch/issues/issue/562).
> > 
> > For example I have a document :
> > 
> > [http://localhost:9200/features/Feature/PFA0005w:pep](http://localhost:9200/features/Feature/PFA0005w:pep)  
> > {  
> > \_index: "features",  
> > \_type: "Feature",  
> > \_id: "PFA0005w:pep",  
> > \_source: {  
> > uniqueName: ""PFA0005w:pep"  
> > ...  
> > coordinates: [  
> > {  
> > region: "Pf3D7\_01",  
> > fmin: 29733,  
> > fmax: 37349,  
> > phase: null,  
> > strand: 0,  
> > }}  
> > ],  
> > ...  
> > }}  
> > }
> > 
> > For which I would like to pull only its coordinates array. If I try :
> > 
> > [http://localhost:9200/features/Feature/PFA0005w:pep?fields=\_source.coordinates](http://localhost:9200/features/Feature/PFA0005w:pep?fields=_source.coordinates)  
> > {  
> > error: "ElasticSearchException[No mapping for field  
> > [\_source.coordinates] in type [Feature]]"  
> > }
> > 
> > Any help constructing the right request would be most appreciated.
> > 
> > Best, Giles.
> > 
> > Attachments:
> > 
> > - logfile.txt
> > - 1 complete entry.png
> > - 3 mapping.png
> > - 2 requesting coordinates field.png

---

<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:12am UTC](https://discuss.elastic.co/t/how-to-retrieve-specific--source-inner-fields/3894/9 "2017-07-06T04:12:21Z")

</div>


