Skip to content

Instantly share code, notes, and snippets.

@rlisowski
Created October 17, 2017 09:26
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 rlisowski/b5ce2d68b21cfbab0a7ad51eab18a3ca to your computer and use it in GitHub Desktop.
Save rlisowski/b5ce2d68b21cfbab0a7ad51eab18a3ca to your computer and use it in GitHub Desktop.
MapFilter es query
query = {
"_source":false,
"query":{
"bool":{
"must":{ "match_all":{} },
"filter":{
"geo_shape":{
"location":{
"relation": "within",
"shape": RGeo::GeoJSON.encode(Shapefile.where(area_name: 'BR2').first.geometry)
}
}
}
}
}
}
ES.with do |client|
client.search(index: 'properties', type: 'property', body: query)
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment