Skip to content

Instantly share code, notes, and snippets.

@2trc
Created October 17, 2015 14:09
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 2trc/4c15213c64bd42af5aa3 to your computer and use it in GitHub Desktop.
Save 2trc/4c15213c64bd42af5aa3 to your computer and use it in GitHub Desktop.
curl -XDELETE 'localhost:9200/my-index'
curl -XPUT 'localhost:9200/my-index' -d '{
"mappings": {
"my-type": {
"properties": {
"message": {
"type": "string"
}
}
}
}
}'
curl -XPUT 'localhost:9200/my-index/.percolator/1' -d '{
"query" : {
"match" : {
"message" : "bonsai tree"
}
}
}'
curl -XGET 'localhost:9200/my-index/my-type/_percolate' -d '{
"doc" : {
"message" : "A new bonsai tree in the office"
}
}'
curl -XPUT 'localhost:9200/my-index/.percolator/2' -d '{
"query" : {
"match" : {
"message" : "\"bonsai in the office\""
}
}
}'
curl -XGET 'localhost:9200/my-index/my-type/_percolate' -d '{
"doc" : {
"message" : "A new bonsai tree in the office"
}
}'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment