I'm mapping congressional districts in elasticsearch but my efforts are returning no results when trying to query by geo shape. Here's some relevant data:
The mapping:
"mappings":{
"house":{
"properties":{
"state_name":{
"type":"text"
},
"district":{
"type":"integer"
},
"shape":{
"type":"geo_shape",
"strategy":"recursive"
}
}
}
An example of a WKT on the shape property: POLYGON((-122.612285 37.815224,-122.501272 37.821212,-122.499764 37.819724,-122.41871 37.852491,-122.418673 37.852505,-122.430183 37.918425,-122.432283 37.929824,-122.373982 37.883884,-122.373782 37.883725,-122.28246 37.709309,-122.28178 37.70823,-122.419802 37.708231,-122.420082 37.708231,-122.440893 37.716405,-122.440999 37.716488,-122.428203 37.731851,-122.428038 37.732016,-122.451147 37.731567,-122.453411 37.731568,-122.463399 37.752981,-122.463433 37.753028,-122.469667 37.738505,-122.470597 37.737665,-122.512732 37.735087,-122.578294 37.733988,-122.584728 37.779156,-122.588174 37.789362,-122.612285 37.815224))
My search query in kibana that is clearly inside that WKT:
GET /house/_search
{
"query":{
"bool": {
"must": {
"match_all": {}
},
"filter": {
"geo_shape": {
"shape": {
"shape": {
"type": "circle",
"coordinates" : [-122.421151, 37.758442],
"radius": "100m"
}
}
}
}
}
}
I've also tried geo shape type point
with intersects
and contains
relation (which is not currently supported). Logically, it seems like circles with radii querying for polygons match the strategy of intersects
best which is why I started trying that effort, but I had no luck.
What else can I do to debug why these documents are not being found?