我想查询哪些形状与ID为500的形状相交?我已经根据这个documentation创建了我的映射。我的查询是基于这个documentation的。我的索引包含大约780个文档,并且是从一个文件批量加载的。
我创建了索引和映射:
PUT lower_x
PUT lower_x/default/_mapping
{
"properties": {
"feature": {
"type": "keyword"
},
"geometry": {
"type": "geo_shape",
"ignore_malformed": true
},
"name": {
"type": "keyword"
}
}
}批量加载我的GeoJSON成功...我的问题是:
GET lower_x/default/_search
{
"query": {
"bool": {
"must": {
"match_all": {}
},
"filter": {
"geo_shape": {
"geometry": {
"indexed_shape": {
"index": "lower_x",
"type": "default",
"id": "500",
"path": "geometry"
},
"relation": "intersects"
}
}
}
}
}
}错误:
{
"error": {
"root_cause": [
{
"type": "query_shard_exception",
"reason": "failed to find geo_shape field [geometry]",
"index_uuid": "9KlMVDyIR0C5Cb1mYQr85g",
"index": "lower_x"
}
],
"type": "search_phase_execution_exception",
"reason": "all shards failed",
"phase": "query",
"grouped": true,
"failed_shards": [
{
"shard": 0,
"index": "lower_x",
"node": "FgJ4CAIjScyNtDv_Mcpn_g",
"reason": {
"type": "query_shard_exception",
"reason": "failed to find geo_shape field [geometry]",
"index_uuid": "9KlMVDyIR0C5Cb1mYQr85g",
"index": "lower_x"
}
}
]
},
"status": 400
}发布于 2018-02-11 23:09:38
我使用的是elasticsearch的版本5,它不支持ignore_malformed属性。这就是问题所在。
https://stackoverflow.com/questions/48730751
复制相似问题