Skip to content

Instantly share code, notes, and snippets.

@barnybug
Created January 12, 2012 18:18
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 barnybug/1602182 to your computer and use it in GitHub Desktop.
Save barnybug/1602182 to your computer and use it in GitHub Desktop.
SERVER='http://127.0.0.1:9200/'
curl -XDELETE "$SERVER/test/"
curl -XPUT "$SERVER/test/"
curl -XPUT "$SERVER/test/a/_mapping" -d '{"a": {"properties": {"field1": {"type": "integer"}}}}'
curl -XPUT "$SERVER/test/b/1" -d '{"field1": 1}'
sleep 1
curl -XGET 'http://localhost:9200/test/a/_search?size=0' -d '{"facets":{"f":{"terms":{"field":"field1"}}},"query":{"match_all":{}}}'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment