Skip to content

Instantly share code, notes, and snippets.

@dakrone
Created December 14, 2012 17:31
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 dakrone/4287171 to your computer and use it in GitHub Desktop.
Save dakrone/4287171 to your computer and use it in GitHub Desktop.
#!/bin/zsh
# elasticsearch 0.20.1 vanilla
curl -s -XPUT "http://localhost:9200/testidx" -d '{"index":{"number_of_shards":1,"number_of_replicas":0}}'
echo
curl -s -XPUT "http://localhost:9200/testidx/msg/1?refresh=true" -d '{"id":"1","message":"test"}'
echo
# this shows the document exists
curl -s "http://localhost:9200/testidx/msg/1?pretty=true"
echo
# this returns 0 hits (should return 1)
curl -s "http://localhost:9200/testidx/msg/_search?q=*:*&pretty=true"
echo
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment