Skip to content

Instantly share code, notes, and snippets.

@Wattenberger
Created July 28, 2016 16:08
Show Gist options
  • Save Wattenberger/29a6461db79a5cee5c4b6df1f87da93c to your computer and use it in GitHub Desktop.
Save Wattenberger/29a6461db79a5cee5c4b6df1f87da93c to your computer and use it in GitHub Desktop.
For Parsely/web#5241
Post info, w/ total page views:
GET casterisk-raws,casterisk-5min-2016.07.28/url,share/_search?ignore_unavailable&timeout=60000&search_type=count&routing=thedailybeast.com
{"query": {"filtered": {"filter": {"bool": {"must": [{"term": {"apikey": "thedailybeast.com"}}, {"range": {"_cache": true, "ts": {"from": "2016-07-27T03:00:00Z"}}}, {"term": {"_cache": false, "metas.canonical_url": "http://www.thedailybeast.com/articles/2016/07/26/prince-george-3-accused-of-being-a-f-king-d-khead-with-white-privilege.html"}}, {"range": {"_cache": false, "ts": {"to": "2016-07-28T15:00:30Z", "from": "2016-07-28T04:00:30Z"}}}, {"indices": {"indices": ["casterisk-5min-2016.07.28"], "filter": {"bool": {"must": [{"range": {"_cache": false, "ts": {"to": "2016-07-28T14:49:00"}}}, {"missing": {"field": "audience_segment_id"}}]}}}}, {"indices": {"indices": ["casterisk-raws"], "filter": {"bool": {"must": [{"range": {"_cache": false, "ts": {"from": "2016-07-28T14:50:00"}}}]}}}}]}}}}, "aggs": {"g0": {"terms": {"execution_hint": "map", "field": "metas.canonical_url", "size": 0}, "aggs": {"views": {"sum": {"field": "metrics.$any/$all/page_view"}}, "shares": {"sum": {"field": "metrics.$any/$all/shares"}}, "go_shares": {"sum": {"field": "metrics.go/$all/shares"}}, "visitors": {"cardinality": {"field": "visitors", "precision_threshold": 250}}, "mobile_views": {"sum": {"field": "metrics.$any/mobile/page_view"}}, "li_shares": {"sum": {"field": "metrics.li/$all/shares"}}, "fb_shares": {"sum": {"field": "metrics.fb/$all/shares"}}, "tw_shares": {"sum": {"field": "metrics.tw/$all/shares"}}, "pi_shares": {"sum": {"field": "metrics.pi/$all/shares"}}, "tablet_views": {"sum": {"field": "metrics.$any/tablet/page_view"}}}}}}
Referrer Categories w/ page views per:
GET casterisk-raws,casterisk-5min-2016.07.28/url/_search?ignore_unavailable&timeout=60000&search_type=count&routing=thedailybeast.com
{"query": {"filtered": {"filter": {"bool": {"must": [{"term": {"apikey": "thedailybeast.com"}}, {"range": {"_cache": true, "ts": {"from": "2016-07-27T03:00:00Z"}}}, {"term": {"_cache": false, "metas.canonical_url": "http://www.thedailybeast.com/articles/2016/07/26/prince-george-3-accused-of-being-a-f-king-d-khead-with-white-privilege.html"}}, {"range": {"_cache": false, "ts": {"to": "2016-07-28T15:00:30Z", "from": "2016-07-28T04:00:30Z"}}}, {"indices": {"indices": ["casterisk-5min-2016.07.28"], "filter": {"bool": {"must": [{"range": {"_cache": false, "ts": {"to": "2016-07-28T14:49:00"}}}, {"missing": {"field": "audience_segment_id"}}]}}}}, {"indices": {"indices": ["casterisk-raws"], "filter": {"bool": {"must": [{"range": {"_cache": false, "ts": {"from": "2016-07-28T14:50:00"}}}]}}}}]}}}}, "aggs": {"g0": {"aggs": {"g1": {"aggs": {"g2": {"terms": {"execution_hint": "map", "field": "referrers.from.domain", "order": {"referrers_views": "desc"}, "size": 0}, "aggs": {"referrers_views": {"sum": {"field": "referrers.$any/$all/page_view"}}, "referrers_url~count": {"cardinality": {"field": "referrers.from.url", "precision_threshold": 250}}}}}, "filters": {"filters": {"referrers_category-search": {"bool": {"must": {"term": {"referrers.from.category": "search"}}}}, "referrers_category-other": {"bool": {"must": {"term": {"referrers.from.category": "other"}}}}, "referrers_category-social": {"bool": {"must": {"term": {"referrers.from.category": "social"}}}}, "referrers_category-internal": {"bool": {"must": {"term": {"referrers.from.category": "internal"}}}}, "referrers_category-direct": {"bool": {"must": {"term": {"referrers.from.category": "direct"}}}}}}}}, "nested": {"path": "referrers"}}}}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment