ES接数据时索引类型对不上报错:failed to find geo_point field [geoPointFiled]

 错误:

{"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"
            }
    }
  }
}

评论 2
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值