From a3eb4f3293e0a4141a2506560741342d29c0b347 Mon Sep 17 00:00:00 2001 From: Trotter Cashion Date: Wed, 24 Oct 2012 17:30:04 -0700 Subject: [PATCH 1/2] Add search query example --- examples/twitter/search_query.body | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 examples/twitter/search_query.body diff --git a/examples/twitter/search_query.body b/examples/twitter/search_query.body new file mode 100644 index 00000000000..f2feb27d4fe --- /dev/null +++ b/examples/twitter/search_query.body @@ -0,0 +1,13 @@ +{ + "queryType": "search", + "dataSource": "twitterstream", + "granularity": "all", + "searchDimensions": ["htags"], + "limit": 1, + "query": { + "type": "fragment", + "values": ["men"], + "sort": { "type": "strlen" } + }, + "intervals":["2012-10-01T00:00/2020-01-01T00"] +} From bcdfece8788f096f53d821ba88b8882651c548ef Mon Sep 17 00:00:00 2001 From: Trotter Cashion Date: Fri, 26 Oct 2012 10:20:56 -0700 Subject: [PATCH 2/2] Allow group_by or search queries in run_client.sh --- examples/twitter/{query.body => group_by_query.body} | 0 examples/twitter/run_client.sh | 6 ++++-- 2 files changed, 4 insertions(+), 2 deletions(-) rename examples/twitter/{query.body => group_by_query.body} (100%) diff --git a/examples/twitter/query.body b/examples/twitter/group_by_query.body similarity index 100% rename from examples/twitter/query.body rename to examples/twitter/group_by_query.body diff --git a/examples/twitter/run_client.sh b/examples/twitter/run_client.sh index b11834ed087..e1a9548713f 100755 --- a/examples/twitter/run_client.sh +++ b/examples/twitter/run_client.sh @@ -7,14 +7,16 @@ shopt -s xpg_echo shopt -s expand_aliases trap "exit 1" 1 2 3 15 -[ ! -e query.body ] && echo "expecting file query.body to be in current directory" && exit 2 +QUERY_FILE="${1:-group_by}_query.body" + +[ ! -e $QUERY_FILE ] && echo "expecting file $QUERY_FILE to be in current directory" && exit 2 for delay in 5 15 15 15 15 15 15 15 15 15 15 do echo "sleep for $delay seconds..." echo " " sleep $delay - curl -X POST 'http://localhost:8080/druid/v2/' -H 'content-type: application/json' -d @query.body + curl -X POST 'http://localhost:8080/druid/v2/' -H 'content-type: application/json' -d @$QUERY_FILE echo " " echo " " done