# URI Request that returns just the \_source, without metadata?

**URL:** <https://discuss.elastic.co/t/uri-request-that-returns-just-the--source-without-metadata/8614>\
**Category:** Elasticsearch\
**Created:** [August 2, 2012, 6:41pm UTC](https://discuss.elastic.co/t/uri-request-that-returns-just-the--source-without-metadata/8614 "2012-08-02T18:41:04Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![Eric\_Jain](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/eric_jain/32/834_2.png) [@Eric\_Jain](https://discuss.elastic.co/u/Eric_Jain)\
**Post date:** [August 2, 2012, 6:41pm UTC](https://discuss.elastic.co/t/uri-request-that-returns-just-the--source-without-metadata/8614/1 "2012-08-02T18:41:04Z")

</div>

e.g. for '[http://localhost:9200/twitter/tweet/\_search?q=user:kimchy](http://localhost:9200/twitter/tweet/_search?q=user:kimchy)' I get:

{  
"\_shards":{  
"total" : 5,  
"successful" : 5,  
"failed" : 0  
},  
"hits":{  
"total" : 1,  
"hits" : [  
{  
"\_index" : "twitter",  
"\_type" : "tweet",  
"\_id" : "1",  
"\_source" : {  
"user" : "kimchy",  
"postDate" : "2009-11-15T14:12:12",  
"message" : "trying out Elastic Search"  
}  
}  
]  
}  
}

But sometimes it would be more useful to have:

{  
...  
"hits":{  
"total" : 1,  
"hits" : [  
{  
"user" : "kimchy",  
"postDate" : "2009-11-15T14:12:12",  
"message" : "trying out Elastic Search"  
}  
]  
}  
}

Is there an option for this, or if not, would this be a useful addition?

---

<div class="post-metadata">

**Author:** ![mvg](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/mvg/32/98890_2.png) [@mvg](https://discuss.elastic.co/u/mvg)\
**Post date:** [August 3, 2012, 11:56am UTC](https://discuss.elastic.co/t/uri-request-that-returns-just-the--source-without-metadata/8614/2 "2012-08-03T11:56:09Z")

</div>

Hi Eric,

I think the field request parameter will suite your needs:

> **[Elasticsearch Platform — Find real-time answers at scale](https://www.elastic.co)**
>
> Power insights and outcomes with the Elasticsearch Platform and AI. See into your data and find answers that matter with enterprise solutions designed to help you build, observe, and protect. Try Elasticsearch free today.

Martijn

On 2 August 2012 20:41, Eric Jain [eric.jain@gmail.com](mailto:eric.jain@gmail.com) wrote:

> e.g. for '[http://localhost:9200/twitter/tweet/\_search?q=user:kimchy](http://localhost:9200/twitter/tweet/_search?q=user:kimchy)' I get:
> 
> {  
> "\_shards":{  
> "total" : 5,  
> "successful" : 5,  
> "failed" : 0  
> },  
> "hits":{  
> "total" : 1,  
> "hits" : [  
> {  
> "\_index" : "twitter",  
> "\_type" : "tweet",  
> "\_id" : "1",  
> "\_source" : {  
> "user" : "kimchy",  
> "postDate" : "2009-11-15T14:12:12",  
> "message" : "trying out Elastic Search"  
> }  
> }  
> ]  
> }  
> }
> 
> But sometimes it would be more useful to have:
> 
> {  
> ...  
> "hits":{  
> "total" : 1,  
> "hits" : [  
> {  
> "user" : "kimchy",  
> "postDate" : "2009-11-15T14:12:12",  
> "message" : "trying out Elastic Search"  
> }  
> ]  
> }  
> }
> 
> Is there an option for this, or if not, would this be a useful addition?

--  
Met vriendelijke groet,

Martijn van Groningen

---

<div class="post-metadata">

**Author:** ![Eric\_Jain](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/eric_jain/32/834_2.png) [@Eric\_Jain](https://discuss.elastic.co/u/Eric_Jain)\
**Post date:** [August 3, 2012, 5:16pm UTC](https://discuss.elastic.co/t/uri-request-that-returns-just-the--source-without-metadata/8614/3 "2012-08-03T17:16:27Z")

</div>

On Fri, Aug 3, 2012 at 4:56 AM, Martijn v Groningen  
[martijn.v.groningen@gmail.com](mailto:martijn.v.groningen@gmail.com) wrote:

> I think the field request parameter will suite your needs:  
> [Elasticsearch Platform — Find real-time answers at scale | Elastic](http://www.elasticsearch.org/guide/reference/api/search/fields.html)

"\_source" is the default already; the question is how to get the  
contents of the \_source unwrapped.

---

<div class="post-metadata">

**Author:** ![phill](https://avatars.discourse-cdn.com/v4/letter/p/779978/32.png) [@phill](https://discuss.elastic.co/u/phill)\
**Post date:** [August 4, 2012, 1:47am UTC](https://discuss.elastic.co/t/uri-request-that-returns-just-the--source-without-metadata/8614/4 "2012-08-04T01:47:28Z")

</div>

Eric,

Can't you request \_source.user, \_source.postDate etc. with some  
appropriate notation?

-Paul  
On 8/3/2012 10:16 AM, Eric Jain wrote:

> On Fri, Aug 3, 2012 at 4:56 AM, Martijn v Groningen  
> [martijn.v.groningen@gmail.com](mailto:martijn.v.groningen@gmail.com) wrote:
> 
> > I think the field request parameter will suite your needs:  
> > [Elasticsearch Platform — Find real-time answers at scale | Elastic](http://www.elasticsearch.org/guide/reference/api/search/fields.html)  
> > "\_source" is the default already; the question is how to get the  
> > contents of the \_source unwrapped.

---

<div class="post-metadata">

**Author:** ![Eric\_Jain](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/eric_jain/32/834_2.png) [@Eric\_Jain](https://discuss.elastic.co/u/Eric_Jain)\
**Post date:** [August 5, 2012, 9:42pm UTC](https://discuss.elastic.co/t/uri-request-that-returns-just-the--source-without-metadata/8614/5 "2012-08-05T21:42:19Z")

</div>

On Fri, Aug 3, 2012 at 6:47 PM, P.Hill [parehill1@gmail.com](mailto:parehill1@gmail.com) wrote:

> Can't you request \_source.user, \_source.postDate etc. with some appropriate  
> notation?

Then I get:

"hits" : [  
{  
"\_index" : "twitter",  
"\_type" : "tweet",  
"\_id" : "1",  
"fields" : {  
"user" : "kimchy",  
"postDate" : "2009-11-15T14:12:12",  
"message" : "trying out Elastic Search"  
}  
}  
]

But what I want is:

"hits" : [  
{  
"user" : "kimchy",  
"postDate" : "2009-11-15T14:12:12",  
"message" : "trying out Elastic Search"  
}  
}  
]

It's not a big deal, but it would be useful to have a quick and  
convenient way to "dump" the original \_source data, with no  
elasticsearch metadata.

---

<div class="post-metadata">

**Author:** ![Clinton\_Gormley](https://avatars.discourse-cdn.com/v4/letter/c/50afbb/32.png) [@Clinton\_Gormley](https://discuss.elastic.co/u/Clinton_Gormley)\
**Post date:** [August 6, 2012, 11:36am UTC](https://discuss.elastic.co/t/uri-request-that-returns-just-the--source-without-metadata/8614/6 "2012-08-06T11:36:27Z")

</div>

> But what I want is:
> 
> "hits" : [  
> {  
> "user" : "kimchy",  
> "postDate" : "2009-11-15T14:12:12",  
> "message" : "trying out Elastic Search"  
> }  
> }  
> ]
> 
> It's not a big deal, but it would be useful to have a quick and  
> convenient way to "dump" the original \_source data, with no  
> elasticsearch metadata.

It's not supported. You always get the metadata I'm afraid

clint

---

<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:** [August 7, 2012, 9:41pm UTC](https://discuss.elastic.co/t/uri-request-that-returns-just-the--source-without-metadata/8614/7 "2012-08-07T21:41:20Z")

</div>

We can potentially support it, should be simple enough actually. Want to open an issue?

On Aug 6, 2012, at 1:36 PM, Clinton Gormley [clint@traveljury.com](mailto:clint@traveljury.com) wrote:

> > But what I want is:
> > 
> > "hits" : [  
> > {  
> > "user" : "kimchy",  
> > "postDate" : "2009-11-15T14:12:12",  
> > "message" : "trying out Elastic Search"  
> > }  
> > }  
> > ]
> > 
> > It's not a big deal, but it would be useful to have a quick and  
> > convenient way to "dump" the original \_source data, with no  
> > elasticsearch metadata.
> 
> It's not supported. You always get the metadata I'm afraid
> 
> clint

---

<div class="post-metadata">

**Author:** ![Eric\_Jain](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/eric_jain/32/834_2.png) [@Eric\_Jain](https://discuss.elastic.co/u/Eric_Jain)\
**Post date:** [August 8, 2012, 12:42am UTC](https://discuss.elastic.co/t/uri-request-that-returns-just-the--source-without-metadata/8614/8 "2012-08-08T00:42:54Z")

</div>

On Tue, Aug 7, 2012 at 2:41 PM, Shay Banon [kimchy@gmail.com](mailto:kimchy@gmail.com) wrote:

> We can potentially support it, should be simple enough actually. Want to open an issue?

> <https://github.com/elastic/elasticsearch/issues/2149>
>
> 'http://localhost:9200/twitter/tweet/\_search?q=user:kimchy' returns:
> 
> \`\`\` json
> {…
> "\_shards":{
> "total" : 5,
> "successful" : 5,
> "failed" : 0
> },
> "hits":{
> "total" : 1,
> "hits" : \[
> {
> "\_index" : "twitter",
> "\_type" : "tweet",
> "\_id" : "1", 
> "\_source" : {
> "user" : "kimchy",
> "postDate" : "2009-11-15T14:12:12",
> "message" : "trying out Elastic Search"
> }
> }
> \]
> }
> }
> \`\`\`
> 
> But sometimes it would be more useful to get a plain "dump" of the \_source data instead:
> 
> \`\`\` json
> {
> ...
> "hits":{
> "total" : 1,
> "hits" : \[
> {
> "user" : "kimchy",
> "postDate" : "2009-11-15T14:12:12",
> "message" : "trying out Elastic Search"
> }
> \]
> }
> }
> \`\`\`

---

<div class="post-metadata">

**Author:** ![phill](https://avatars.discourse-cdn.com/v4/letter/p/779978/32.png) [@phill](https://discuss.elastic.co/u/phill)\
**Post date:** [August 14, 2012, 4:26pm UTC](https://discuss.elastic.co/t/uri-request-that-returns-just-the--source-without-metadata/8614/9 "2012-08-14T16:26:57Z")

</div>

Would that simply be an extra parameter on the URI, for example brief=1

[http://localhost:9200/twitter/tweet/\_search?q=user:kimchy&pretty=1&brief=1](http://localhost:9200/twitter/tweet/_search?q=user:kimchy&pretty=1&brief=1)

Maybe using a name which could be re-used elsewhere in requests where  
"just the data please" might come in handy.

-Paul

On 8/7/2012 5:42 PM, Eric Jain wrote:

> On Tue, Aug 7, 2012 at 2:41 PM, Shay Banon [kimchy@gmail.com](mailto:kimchy@gmail.com) wrote:
> 
> > We can potentially support it, should be simple enough actually. Want to open an issue?  
> > [URI Request that returns just the \_source, without metadata · Issue #2149 · elastic/elasticsearch · GitHub](https://github.com/elasticsearch/elasticsearch/issues/2149)

--

---

<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:16am UTC](https://discuss.elastic.co/t/uri-request-that-returns-just-the--source-without-metadata/8614/10 "2017-07-06T03:16:26Z")

</div>


