-
-
Save hbbtstar/8b6cafef5e1cf8ea8f10179ea69d1cda to your computer and use it in GitHub Desktop.
uproxx slow query
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
GET casterisk-5min-2016.08.03,casterisk-5min-2016.08.02,casterisk-5min-2016.08.01/url/_search?ignore_unavailable&timeout=60000&search_type=count&routing=uproxx.com | |
{ | |
"query": { | |
"filtered": { | |
"filter": { | |
"bool": { | |
"must": [ | |
{ | |
"term": { | |
"apikey": "uproxx.com" | |
} | |
}, | |
{ | |
"range": { | |
"_cache": true, | |
"ts": { | |
"to": "2016-08-03T03:59:00Z", | |
"from": "2016-08-01T04:00:00Z" | |
} | |
} | |
}, | |
{ | |
"term": { | |
"metas.page_type": "post" | |
} | |
}, | |
{ | |
"indices": { | |
"indices": [ | |
"casterisk-5min-2016.08.01", | |
"casterisk-5min-2016.08.02", | |
"casterisk-5min-2016.08.03" | |
], | |
"filter": { | |
"bool": { | |
"must": [ | |
{ | |
"missing": { | |
"field": "audience_segment_id" | |
} | |
} | |
] | |
} | |
} | |
} | |
} | |
] | |
} | |
} | |
} | |
}, | |
"aggs": { | |
"g0": { | |
"terms": { | |
"execution_hint": "map", | |
"field": "metas.canonical_url", | |
"order": { | |
"views": "desc" | |
}, | |
"size": 1000 | |
}, | |
"aggs": { | |
"metas": { | |
"top_hits": { | |
"sort": [ | |
{ | |
"index_ts": { | |
"order": "desc" | |
} | |
} | |
], | |
"size": 1, | |
"_source": { | |
"include": "metas.canonical_url" | |
} | |
} | |
}, | |
"views": { | |
"sum": { | |
"field": "metrics.$any/$all/page_view" | |
} | |
} | |
} | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment