Skip to content

Instantly share code, notes, and snippets.

@brett--anderson
Created May 8, 2012 05:51
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 brett--anderson/2632887 to your computer and use it in GitHub Desktop.
Save brett--anderson/2632887 to your computer and use it in GitHub Desktop.
Elasticsearch setup to demonstrate filtering percolators
curl -XPUT http://localhost:9200/test/
curl -XPUT localhost:9200/_percolator/test/perc_1 -d "{ \"color\" : \"blue\", \"query\" : { \"term\" : { \"sport\" : \"tennis\" } } }"
curl -XPUT localhost:9200/_percolator/test/perc_2 -d "{ \"color\" : \"blue\", \"query\" : { \"term\" : { \"sport\" : \"sailing\" } } }"
curl -XGET localhost:9200/test/type1/_percolate -d "{ \"doc\" : { \"sport\" : \"tennis\" }}"
curl -XGET localhost:9200/test/type1/_percolate -d "{ \"doc\" : { \"sport\" : \"tennis\" }, \"query\" : { \"term\" : { \"color\" : \"blue\" } }}"
curl -XDELETE http://localhost:9200/test/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment