Created
July 19, 2019 14:46
-
-
Save sany2k8/ec0145738babca643f0a369e55546c85 to your computer and use it in GitHub Desktop.
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 /hotes_properties/_search | |
{ | |
"size": 10, | |
"query": { | |
"bool": { | |
"must": [ | |
{ | |
"match": { | |
"published": true | |
} | |
}, | |
{ | |
"match": { | |
"country": "South Africa" | |
} | |
}, | |
{ | |
"match": { | |
"country_code": "ZA" | |
} | |
}, | |
{ | |
"geo_bounding_box": { | |
"latlon": { | |
"top_left": { | |
"lat": -29.39, | |
"lon": 19.34 | |
}, | |
"bottom_right": { | |
"lat": -35.815573, | |
"lon": 17.4699208 | |
} | |
} | |
} | |
}, | |
{ | |
"range": { | |
"min_stay": { | |
"gte": 1, | |
"lte": 40 | |
} | |
} | |
}, | |
{ | |
"range": { | |
"usd_price": { | |
"gte": 1, | |
"lte": 500 | |
} | |
} | |
} | |
], | |
"should": [ | |
{ | |
"match": { | |
"feed": 11 | |
} | |
}, | |
{ | |
"match": { | |
"feed": 12 | |
} | |
}, | |
{ | |
"match": { | |
"parent_path.keyword": "1557308" | |
} | |
}, | |
{ | |
"match": { | |
"location_id": "1557308" | |
} | |
} | |
] | |
} | |
}, | |
"aggs": { | |
"aggs_by_feed": { | |
"terms": { | |
"field": "feed", | |
"order": { | |
"_key": "desc" | |
} | |
}, | |
"aggs": { | |
"tops": { | |
"top_hits": { | |
"from": 0, | |
"size": 48, | |
"_source": [ | |
"id", | |
"usd_price" | |
] | |
} | |
} | |
} | |
} | |
}, | |
"sort": [ | |
{ | |
"ranking": { | |
"order": "desc" | |
} | |
} | |
] | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment