Skip to content

Instantly share code, notes, and snippets.

@flrt
Last active August 29, 2015 14:26
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 flrt/a9f29c838bfa06a2faa5 to your computer and use it in GitHub Desktop.
Save flrt/a9f29c838bfa06a2faa5 to your computer and use it in GitHub Desktop.
ElasticSearch Query+Filter - tests
#!/usr/bin/env bash
echo "\n Delete old index"
curl -X DELETE 'http://localhost:9200/units
curl -XPUT 'http://localhost:9200/units'
echo "\n Add documents"
curl -XPUT 'http://localhost:9200/units/unit/123' -d '{
"title": "CARDIOLOGY new",
"code": "123",
"user": {
"name": "JACK"
}
}'
curl -XPUT 'http://localhost:9200/units/unit/889' -d '{
"title": "CARDIOLOGY old",
"code": "889",
"user": {
"name": "JACK"
},
"closed": "2015-07-01T10:00:00"
}'
curl -XPUT 'http://localhost:9200/units/unit/444' -d '{
"title": "LABORATORY",
"code": "444",
"user": {
"name": "JOHN"
}
}'
curl -XPUT 'http://localhost:9200/units/unit/545' -d '{
"title": "RADIOLOGY",
"code": "545",
"user": {
"name": "JACK"
}
}'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment