Skip to content

Instantly share code, notes, and snippets.

@ian-bartholomew
Last active August 29, 2015 14:13
Show Gist options
  • Save ian-bartholomew/c80654f30ee98bf08505 to your computer and use it in GitHub Desktop.
Save ian-bartholomew/c80654f30ee98bf08505 to your computer and use it in GitHub Desktop.
Elasticsearch percolate test
- create -
curl -XPUT 'localhost:9200/my-index/my-type/1' -d '{"title" : "Coffee percolator", "body" : "A coffee percolator is a type of ..."}'
- search -
curl -XGET 'localhost:9200/my-index/_search' -d '{"query" : {"match" : {"body" : "coffee"}}}'
- get all -
curl -XGET 'localhost:9200/my-index/_search?pretty=true'
- Register a query -
curl -XPUT 'localhost:9200/my-index/.percolator/1' -d '{"query" : {"match" : {"body" : "coffee"}}}'
- Percolate a document -
curl -XGET 'localhost:9200/my-index/my-type/_percolate?pretty=true' -d '{"doc" : {"title" : "Coffee percolator","body" : "A coffee percolator is a type of …"}}'
- get that doc -
curl -XGET 'localhost:9200/my-index/my-type/1'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment