Skip to content

Working with TweetSets Data

Dolsy Smith edited this page Dec 8, 2022 · 1 revision

Aggregating Tweets from a particular collection by date

  1. Create a query.json file.
{ "size": 0,
	"query": {
		"range" :{
				"created_at": {
					"lte": "2022-05-17"
				}
			}
		},
	"aggregations": {
		"tweetHist": {
			"date_histogram": {
				"field": "created_at",
				"calendar_interval": "1d"
			}
		}
	}
}
  1. Issue a CURL command
# Replace hostname with the name of the application host server
# Replace index with the TweetSets index id
curl -X GET "[hostname]:9200/tweets-[index]/_search" -H 'Content-Type: application/json' -d @query.json > result.json