Last active
August 29, 2015 14:26
-
-
Save flrt/a9f29c838bfa06a2faa5 to your computer and use it in GitHub Desktop.
ElasticSearch Query+Filter - tests
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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