我有两个索引,都有 > 200 万个包含localId
s (映射到keyword
)和地理空间数据的文档。两个索引都geo_shape
用作映射),因此映射如下所示:
{
"properties": {
"localId": {
"type": "keyword"
},
"geometry": {
"type": "geo_shape"
}
}
}
我已经成功地对数据运行边界框查询,但我正在努力运行与点查询的距离。文档给出了针对 geo_shape data 运行的查询的明确示例,但我收到以下错误:
{
"error" : {
"root_cause" : [
{
"type" : "query_shard_exception",
"reason" : "field [geometry] is not a geo_point field",
"index_uuid" : "e7-HPZmUR4Wpu96W6K_YXw",
"index" : "test1"
}
],
"type" : "search_phase_execution_exception",
"reason" : "all shards failed",
"phase" : "query",
"grouped" : true,
"failed_shards" : [
{
"shard" : 0,
"index" : "test1",
"node" : "FAu7pbAtQti7e9aRaX4-bg",
"reason" : {
"type" : "query_shard_exception",
"reason" : "field [geometry] is not a geo_point field",
"index_uuid" : "e7-HPZmUR4Wpu96W6K_YXw",
"index" : "test1"
}
}
]
},
"status" : 400
}
知道我错过了什么能够对 geo_shape 数据进行距离处理吗?
弹性搜索详细信息:
{
"name" : "server-name",
"cluster_name" : "elasticsearch",
"cluster_uuid" : "1SqVbKmGR5qxG6bcpjxasg",
"version" : {
"number" : "7.10.2",
"build_flavor" : "oss",
"build_type" : "deb",
"build_hash" : "747e1cc71def077253878a59143c1f785afa92b9",
"build_date" : "2021-01-13T00:42:12.435326Z",
"build_snapshot" : false,
"lucene_version" : "8.7.0",
"minimum_wire_compatibility_version" : "6.8.0",
"minimum_index_compatibility_version" : "6.0.0-beta1"
},
"tagline" : "You Know, for Search"
}