My documents have geo_shapes to associate them to an area. If I give ES (1.7) a geo_point I'm wanting it to give me back the documents where the point falls within that area.
I've recreated with the following toy example:-
# create the index
put location_test
put location_test/_mapping/place
{
"place": {
"properties": {
"message": {"type": "string"},
"coverage": {"type": "geo_shape"}
}
}
}
# check the mapping is correct
get location_test/place/_mapping
# location 1
put location_test/place/1
{
"message": "we will be in this box",
"coverage": {
"type" : "envelope",
"coordinates" : [[1, 0], [0, 1] ]
}
}
# location 2
put location_test/place/2
{
"message": "we will be outside this box",
"coverage": {
"type" : "envelope",
"coordinates" : [[2, 1], [1, 2] ]
}
}
# all documents returned - OK
get location_test/place/_search
{
"query": { "match_all": {}}
}
# should only get document 1, but get both.
get location_test/place/_search
{
"query": {
"geo_shape": {
"coverage": {
"shape": {
"type": "point"
"coordinates": [0.1,0.1]
}
}
}
}
}