Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- {
- "size": 0,
- "query": {
- "bool": {
- "filter": {
- "bool": {
- "must": [
- {"exists": {"field": "from_geo_city_id"}},
- {"exists": {"field": "to_geo_city_id"}},
- {"exists": {"field": "from_country"}},
- {"exists": {"field": "to_country"}},
- {"term": {"type": "route"}}
- ]
- }
- }
- }
- },
- "aggs": {
- "orders_count": {
- "terms": {
- "field": "city_from_to",
- "order": {
- "_count": "desc"
- }
- },
- "aggs": {
- "order_data": {
- "top_hits": {
- "size": 1,
- "_source": {
- "include": [
- "data"
- ]
- }
- }
- }
- }
- }
- }
- }
Add Comment
Please, Sign In to add comment