Skip to content

Instantly share code, notes, and snippets.

@hbbtstar
Created August 3, 2016 15:29
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save hbbtstar/8b6cafef5e1cf8ea8f10179ea69d1cda to your computer and use it in GitHub Desktop.
Save hbbtstar/8b6cafef5e1cf8ea8f10179ea69d1cda to your computer and use it in GitHub Desktop.
uproxx slow query
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