Skip to content

Instantly share code, notes, and snippets.

@rlisowski
Created October 17, 2017 09:28
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/1d8cabfa7b49ae95f2351765f92040cb to your computer and use it in GitHub Desktop.
Save rlisowski/1d8cabfa7b49ae95f2351765f92040cb to your computer and use it in GitHub Desktop.
MapFilter es query indexed shape
query = {
"_source":false,
"query":{
"bool":{
"must":{ "match_all":{} },
"filter":{
"geo_shape":{
"location":{
"relation":"within",
"indexed_shape": {
"index": 'shapefiles',
"type": 'shapefile',
"id": 'BR2',
"path": '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