Skip to content

Instantly share code, notes, and snippets.

@devth
Last active September 11, 2017 18:21
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 devth/d1f271bf9c43f25ec586715424544892 to your computer and use it in GitHub Desktop.
Save devth/d1f271bf9c43f25ec586715424544892 to your computer and use it in GitHub Desktop.
es_query() {
port="${port?$port must be set}"
pass="${pass?$pass must be set}"
query="${1?Query argument is required}"
curl -i -u "elastic:$pass" -XGET \
-H 'Content-Type: application/json' \
"https://localhost:$port/patient/_search?pretty" -d "
{
\"query\": {
\"match\": {
\"_all\": \"$query\"
}
}
}"
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment