错误:
{"error":{"root_cause":[{"type":"query_shard_exception","reason":"failed to find geo_point field [geoPointFiled]","index_uuid":"kSLBp959TPGbNiTf3c0vAg","index":"map_data_address"}],"type":"search_phase_execution_exception","reason":"all shards failed","phase":"query","grouped":true,"failed_shards":[{"shard":0,"index":"map_data_address","node":"HgPYdB43RZWjoMzFsAccmw","reason":{"type":"query_shard_exception","reason":"failed to find geo_point field [geoPointFiled]","index_uuid":"kSLBp959TPGbNiTf3c0vAg","index":"map_data_address"}}]},"status":400}
解决办法:
@ESMapping(datatype = DataType.geo_point_type)
private EsGeoPoint geoPointFiled;
我这里是解析第三方数据然后接到我们的es库中
我这里就是接的数据中geoPointFiled是geo_point格式的而es库不是,所以导致数据接不进来报错,这种情况只能重建索引,把原来的删掉重新建一个废话不多说,上代码:
PUT 索引名
{
"mappings": {
"properties": {
"字段名": {
"type": "geo_point"
}
}
}
}