Scala 弹性体4s和x2B;在同一位置使用两个文档进行elasticsearch大地距离查询
我使用Elasticsearch索引地理数据,我有两个索引点Scala 弹性体4s和x2B;在同一位置使用两个文档进行elasticsearch大地距离查询,scala,search,
elasticsearch,geospatial,elastic4s,Scala,Search,
elasticsearch,Geospatial,Elastic4s,我使用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
{
_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的错误吗