我使用Elasticsearch对地理数据进行索引,我有两个索引点;
{
_index: "shops",
_type: "coffee",
_id: "2",
_version: 73,
found: true,
_source: {
location: {
lat: 50,
lon: 50
},
name: "some random cafe"
}
}
然后我还有另外一点;
{
_index: "shops",
_type: "coffee",
_id: "3",
_version: 73,
found: true,
_source: {
location: {
lat: 50,
lon: 50
},
name: "another random cafe"
}
}
映射正确
{
shops: {
mappings: {
coffee: {
dynamic: "true",
numeric_detection: true,
properties: {
location: {
type: "geo_point",
lat_lon: true,
geohash: true
},
name: {
type: "string",
format: "dateOptionalTime"
}
}
}
}
}
}
我然后查询500公里范围内的所有点(49.9999,49.9999),我确信它在距离内;
val lat: Double = 50
val lat: Double = 49.9999
val dist: String = "500km"
client execute {
search in “shops" -> “coffee" filter {
and (
geoDistance("location") point(lat, lon) distance dist,
or(modelIdTerms:_*)
)
} sourceInclude(“name")
} await
只给我一击。通过curl
完全相同的查询给了我两个点击。这可能是Elastic4s的一个错误吗?