Created
October 17, 2017 09:28
-
-
Save rlisowski/1d8cabfa7b49ae95f2351765f92040cb to your computer and use it in GitHub Desktop.
MapFilter es query indexed shape
This file contains hidden or 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
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