我有两个索引,都有>包含localId
s(映射到keyword
(和地理空间数据的200万个文档。两个索引都使用geo_shape
作为映射(,因此映射如下所示:
{
"properties": {
"localId": {
"type": "keyword"
},
"geometry": {
"type": "geo_shape"
}
}
}
我已经成功地对数据运行了边界框查询,但我很难运行距离点查询。文档给出了针对geo_shape数据运行查询的明确示例,但我得到了一个错误:
{
"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
}
知道我错过了什么吗?为了能够根据地理形状数据进行远程工作?
弹性搜索细节:
{
"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"
}
7.10中的geo_distance
查询仅支持geo_point
字段。
对geo_shape
的支持始于7.11