Sure.
Ok, I will provide the response I get for a search in sample 1. I
will provide what I would like to get in sample 2.
I search via URL parameters :
http://localhost:9200/twitter/tweet/_search?q=message:elastic
Thanks in advance for taking a look.
Sample 1 :
{"_shards":{"total":5,"successful":5,"failed":0},"hits":{"total":3,"max_score":0.19178301,"hits":[{"_index":"twitter","_type":"tweet","_id":"03b39eaa-6c53-4015-8ea8-0f29a90b5925","_score":0.19178301,
"_source" : {
"user" : "yoyo",
"postDate" : "2009-11-15T14:12:12",
"message" : "Elastic is fun"
}},{"_index":"twitter","_type":"tweet","_id":"6d89b8e9-4485-4993-a898-04f6c46a45b3","_score":0.15342641,
"_source" : {
"user" : "bulgogi",
"postDate" : "2009-11-15T14:12:12",
"message" : "Elastic Search is cool"
}},{"_index":"twitter","_type":"tweet","_id":"cddec754-a7f9-43f5-9179-0b03619db9fc","_score":0.15342641,
"_source" : {
"user" : "kimchy",
"postDate" : "2009-11-15T14:12:12",
"message" : "trying out Elastic Search"
}}]}}
Sample 2 :
[{
"user" : "yoyo",
"postDate" : "2009-11-15T14:12:12",
"message" : "Elastic is fun"
}, {
"user" : "bulgogi",
"postDate" : "2009-11-15T14:12:12",
"message" : "Elastic Search is cool"
}, {
"user" : "kimchy",
"postDate" : "2009-11-15T14:12:12",
"message" : "trying out Elastic Search"
}]
On Mon, Oct 11, 2010 at 8:30 PM, Shay Banon
shay.banon@elasticsearch.com wrote:
Not sure I understand.., what do you mean directly? Do you want to get it as
part of a search response for each hit? Do you maybe want to get just part
of the _source? Maybe an example would help...
On Mon, Oct 11, 2010 at 9:27 PM, Ted Karmel ted.karmel@gmail.com wrote:
Sorry for not being specific. What I meant is only getting the
_source of each hit directly (without the contextual information like
_index _type _id etc... ).
On Mon, Oct 11, 2010 at 7:23 PM, Shay Banon
shay.banon@elasticsearch.com wrote:
This is what you get by default when you search (for example, with just
a
query). Do you not get it back?
On Mon, Oct 11, 2010 at 8:17 PM, Ted Karmel ted.karmel@gmail.com
wrote:
Pardon for bringing this up again as I remember reading a post on the
mailing list about this. But, I can't seem to find it again.
Basically, I just would like to get the _source of each hit (e.g. the
original json document that was sent). I think it is doable via
scripts / filters.
I would appreciate anybody pointing me in the right direction or
including a sample code line.
Thanks.