3 QUERY_FILE=${1:-query.json}
5 HOST_URL=${3:-http://localhost:9200}
6 URL=$HOST_URL/$INDEX/_search
9 echo "Usage: $0 [QUERY_FILE [INDEX [HOST_URL]]]"
11 echo "This script automatically sends the query file to elasticsearch"
12 echo "each time it's modified."
15 if [ "${1}" == "--help" ];
21 echo "Querying '$URL' with '$QUERY_FILE'"
24 curl -XGET "$URL" -H 'Content-Type: application/json' -d"@$QUERY_FILE" | js-beautify
26 inotifywait -e modify query.json