Eric_Jain
(Eric Jain)
August 2, 2012, 6:41pm
1
e.g. for '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?
mvg
(Martijn Van Groningen)
August 3, 2012, 11:56am
2
Hi Eric,
I think the field request parameter will suite your needs:
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 wrote:
e.g. for '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
Eric_Jain
(Eric Jain)
August 3, 2012, 5:16pm
3
On Fri, Aug 3, 2012 at 4:56 AM, Martijn v Groningen
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
"_source" is the default already; the question is how to get the
contents of the _source unwrapped.
phill
(phill)
August 4, 2012, 1:47am
4
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 wrote:
I think the field request parameter will suite your needs:
Elasticsearch Platform — Find real-time answers at scale | Elastic
"_source" is the default already; the question is how to get the
contents of the _source unwrapped.
Eric_Jain
(Eric Jain)
August 5, 2012, 9:42pm
5
On Fri, Aug 3, 2012 at 6:47 PM, P.Hill 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.
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
kimchy
(Shay Banon)
August 7, 2012, 9:41pm
7
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 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
Eric_Jain
(Eric Jain)
August 8, 2012, 12:42am
8
On Tue, Aug 7, 2012 at 2:41 PM, Shay Banon kimchy@gmail.com wrote:
We can potentially support it, should be simple enough actually. Want to open an issue?
opened 12:42AM - 08 Aug 12 UTC
closed 11:03AM - 22 Aug 14 UTC
discuss
'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"
}
]
}
}
```
phill
(phill)
August 14, 2012, 4:26pm
9
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
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 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
--