Skip to content

Instantly share code, notes, and snippets.

@ejlangev
Created June 22, 2015 22:35
Show Gist options
  • Save ejlangev/fb17a0d3c225b60fc968 to your computer and use it in GitHub Desktop.
Save ejlangev/fb17a0d3c225b60fc968 to your computer and use it in GitHub Desktop.
{
"size": 0,
"query": {
"filtered": {
"filter": {
"bool": {
"must": [
{
"exists": {
"field": "address.full"
}
},
{
"exists": {
"field": "location"
}
},
{
"exists": {
"field": "listPrice"
}
},
{
"geo_bounding_box": {
"location": {
"top_left": {
"lon": -74.091796875,
"lat": 40.763671875
},
"bottom_right": {
"lon": -73.8984375,
"lat": 40.693359375
}
}
}
},
{
"range": {
"listPrice": {
"gt": 100000,
"lt": 3000000
}
}
}
]
}
}
}
},
"aggregations": {
"myLarge-GrainGeoHashGrid": {
"geohash_grid": {
"field": "location",
"precision": 9
},
"aggregations": {
"listings": {
"top_hits": {
"size": 1,
"_source": {
"include": [
"address",
"bathrooms",
"bedrooms",
"broker.name",
"brokerage",
"description",
"details",
"detailViewUrl",
"email",
"lastUpdateDate",
"listDate",
"listingDate",
"listingAgent",
"listingID",
"listingStatus",
"listingParticipants",
"listingTitle",
"listingURL",
"listPrice",
"images",
"livingArea",
"mlsNumber",
"provider",
"providerName",
"providerListingID",
"publishDate",
"regionalMLSNumberpubliclyVisible",
"regionalMLSNumber.value",
"status",
"title",
"virtualTourUrl",
"virtualTours",
"vow",
"webBugUrl",
"location",
"fips",
"name",
"boundingBox",
"state",
"shape",
"propertyType",
"propertySubType",
"type",
"name"
]
}
}
}
}
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment