Skip to content

Instantly share code, notes, and snippets.

@drewr
Created December 19, 2012 20:03
Show Gist options
  • Save drewr/4339977 to your computer and use it in GitHub Desktop.
Save drewr/4339977 to your computer and use it in GitHub Desktop.
curl -s -XPUT localhost:9200/test/t/1 -d'
{
"message" : "this is a test!"
}
'
curl -s localhost:9200/test/_search -d '
{
"query" : {
"match_phrase" : {
"message" : "this is a test"
}
}
}
' | json_pp
# {
# "hits" : {
# "hits" : [
# {
# "_source" : {
# "message" : "this is a test!"
# },
# "_score" : 0.30685282,
# "_index" : "test",
# "_id" : "1",
# "_type" : "t"
# }
# ],
# "max_score" : 0.30685282,
# "total" : 1
# },
# "timed_out" : false,
# "_shards" : {
# "failed" : 0,
# "successful" : 5,
# "total" : 5
# },
# "took" : 4
# }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment