Return polygons in a given point

Hi,
I am trying to return all the polygons in a given point.
But my query returns all the docs in the index even if the given point doesn't falls in polygon 1, 2 & 3
Index, docs and the query are given below

ref. http://geojson.io/#map=7/-31.775/144.382

PUT /example3
{

"mappings": {
"_doc": {
"properties": {
"features": {
"properties": {
"geometry": {
"type": "geo_shape"

          }
        }
      }
    }
  }
}

}

POST /example3/_doc?refresh
{
"type": "FeatureCollection",
"features": [
{
"type": "Feature",
"geometry": {
"name": "Poly - 01",
"type": "Polygon",
"coordinates": [
[
[
143.02001953125,
-38.55246141354153
],
[
146.162109375,
-38.55246141354153
],
[
146.162109375,
-36.399178286076534
],
[
143.02001953125,
-36.399178286076534
],
[
143.02001953125,
-38.55246141354153
]
]
]
}
},
{
"type": "Feature",
"geometry": {
"name": "Poly - 02",
"type": "Polygon",
"coordinates": [
[
[
144.744873046875,
-37.45741810262937
],
[
147.7496337890625,
-37.45741810262937
],
[
147.7496337890625,
-35.880148964883595
],
[
144.744873046875,
-35.880148964883595
],
[
144.744873046875,
-37.45741810262937
]
]
]
}
},
{
"type": "Feature",
"geometry": {
"name": "Poly - 03",
"type": "Polygon",
"coordinates": [
[
[
145.491943359375,
-37.983174833513374
],
[
146.97509765625,
-37.983174833513374
],
[
146.97509765625,
-36.96306042436515
],
[
145.491943359375,
-36.96306042436515
],
[
145.491943359375,
-37.983174833513374
]
]
]
}
},
{
"type": "Feature",
"geometry": {
"name": "Poly - 04",
"type": "Polygon",
"coordinates": [
[
[
142.833251953125,
-35.11990857099681
],
[
147.3486328125,
-35.11990857099681
],
[
147.3486328125,
-32.861132322810946
],
[
142.833251953125,
-32.861132322810946
],
[
142.833251953125,
-35.11990857099681
]
]
]
}
},
{
"type": "Feature",
"properties": {},
"geometry": {
"name": "Poly - 05",
"type": "Polygon",
"coordinates": [
[
[
139.537353515625,
-31.43803717312445
],
[
140.504150390625,
-31.43803717312445
],
[
140.504150390625,
-30.60954979719083
],
[
139.537353515625,
-30.60954979719083
],
[
139.537353515625,
-31.43803717312445
]
]
]
}
}

]

}

GET /example3/_search
{
"query":{
"bool": {
"must": {
"match_all": {}
},
"filter": {
"geo_shape": {
"features.geometry": {
"shape": {
"type": "point",
"coordinates" :
[
146.0138,
-37.1734

                            ]
                        
                    }
                }
            }
        }
    }
}

}

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.