根据坐标查找 坐标落在店铺范围的店铺
构建mapping
构建mapping
PUT /example
{
"mappings": {
"doc": {
"properties": {
"location": {
"type": "geo_shape"
}
}
}
}
}
初始化数据
POST /example/doc
{
"location" : {
"type" : "polygon",
"coordinates" : [
[ [100.0, 0.0], [101.0, 0.0], [101.0, 1.0], [100.0, 1.0], [100.0, 0.0] ]
]
}
}
上例中大量的方括号可能看起来让人困惑,不过实际上 GeoJSON 的语法非常简单: