Skip to content

Instantly share code, notes, and snippets.

@forste
Created May 28, 2012 13:40
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save forste/2819256 to your computer and use it in GitHub Desktop.
Save forste/2819256 to your computer and use it in GitHub Desktop.
default put, get, delete
curl -XPUT 'http://localhost:9200/twitter/tweet/1' -d '{
"user" : "kimchy",
"post_date" : "2009-11-15T14:12:12",
"message" : "trying out Elastic Search"
}'
//shows data from above
curl -XGET 'http://localhost:9200/twitter/tweet/_search' -d '{
query : {
bool : {
should : [
{
matchAll : {}
}
],
must: [
{
text: {
user : {
query: "kimchy",
operator: "and"
}
}
}
]
}
}
}'
curl -XDELETE 'http://localhost:9200/twitter/tweet/_query' -d '{
"term" : { "user" : "kimchy" }
}'
//tweet is deleted
curl -XGET 'http://localhost:9200/twitter/tweet/_search' -d '{
query : {
bool : {
should : [
{
matchAll : {}
}
],
must: [
{
text: {
user : {
query: "kimchy",
operator: "and"
}
}
}
]
}
}
}'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment