Skip to content

Instantly share code, notes, and snippets.

Created December 21, 2012 12:06
Show Gist options
  • Save anonymous/4352432 to your computer and use it in GitHub Desktop.
Save anonymous/4352432 to your computer and use it in GitHub Desktop.
{"ok":true,"acknowledged":true}
{"ok":true,"_index":"rctest","_type":"attendants","_id":"123","_version":1}
{"ok":true,"_index":"rctest","_type":"attendants","_id":"321","_version":1}
*** REFRESH
{"ok":true,"_shards":{"total":10,"successful":5,"failed":0}}
*** All documents
{"took":2,"timed_out":false,"_shards":{"total":5,"successful":5,"failed":0},"hits":{"total":2,"max_score":1.0,"hits":[{"_index":"rctest","_type":"attendants","_id":"321","_score":1.0, "_source" : {"is_cool":false}},{"_index":"rctest","_type":"attendants","_id":"123","_score":1.0, "_source" : {"is_cool":true}}]}}
*** Result of query A
{"took":2,"timed_out":false,"_shards":{"total":5,"successful":5,"failed":0},"hits":{"total":0,"max_score":null,"hits":[]}}
*** REFRESH
{"ok":true,"_shards":{"total":10,"successful":5,"failed":0}}
*** All documents
{"took":1,"timed_out":false,"_shards":{"total":5,"successful":5,"failed":0},"hits":{"total":2,"max_score":1.0,"hits":[{"_index":"rctest","_type":"attendants","_id":"321","_score":1.0, "_source" : {"is_cool":false}},{"_index":"rctest","_type":"attendants","_id":"123","_score":1.0, "_source" : {"is_cool":true}}]}}
*** Result of query B
{"took":1,"timed_out":false,"_shards":{"total":5,"successful":5,"failed":0},"hits":{"total":1,"max_score":0.30685282,"hits":[{"_index":"rctest","_type":"attendants","_id":"321","_score":0.30685282, "_source" : {"is_cool":false}}]}}
curl -XDELETE http://localhost:9200/rctest
echo
curl -XPOST http://localhost:9200/rctest/attendants/123 -d '{"is_cool":true}'
echo
curl -XPOST http://localhost:9200/rctest/attendants/321 -d '{"is_cool":false}'
echo
echo "*** REFRESH"
curl -XPOST http://localhost:9200/rctest/_refresh
echo
echo "*** All documents"
curl -XGET http://localhost:9200/rctest/attendants/_search
echo
echo "*** Result of query A"
curl -XGET http://localhost:9200/rctest/attendants/_search -d '{"query":{"term":{"is_cool":true}}}'
echo
echo "*** REFRESH"
curl -XPOST http://localhost:9200/rctest/_refresh
echo
echo "*** All documents"
curl -XGET http://localhost:9200/rctest/attendants/_search
echo
echo "*** Result of query B"
curl -XGET http://localhost:9200/rctest/attendants/_search -d '{"query":{"term":{"is_cool":false}}}'
echo
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment