Skip to content

Instantly share code, notes, and snippets.

@gerektoolhy
Created January 20, 2013 15:43
Show Gist options
  • Save gerektoolhy/4579407 to your computer and use it in GitHub Desktop.
Save gerektoolhy/4579407 to your computer and use it in GitHub Desktop.
elastic search query
dark@ubuntu:~$ curl -XGET 'http://localhost:9200/twitter/tweet/2?pretty=true'
{
"_index" : "twitter",
"_type" : "tweet",
"_id" : "2",
"_version" : 1,
"exists" : true, "_source" :
{
"user": "kimchy",
"postDate": "2009-11-15T14:12:12",
"message": "Another tweet, will it be indexed?"
}
dark@ubuntu:~$ curl -XGET 'http://localhost:9200/twitter/tweet/_search?q=user:kimchy&pretty=true'
{
"took" : 3,
"timed_out" : false,
"_shards" : {
"total" : 5,
"successful" : 5,
"failed" : 0
},
"hits" : {
"total" : 0,
"max_score" : null,
"hits" : [ ]
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment