OpenSearch报错汇总

报错二、插入数据时间格式异常

"caused_by"=>{"type"=>"illegal_argument_exception", "reason"=>"failed to parse date field [2022-12-09 19:31:52] with format [strict_date_optional_time||epoch_millis]", "caused_by"=>{"type"=>"date_time_parse_exception", "reason"=>"Failed to parse with all enclosed parsers"}}}}}}

关键词:
        epoch_millis,毫秒;

分析:源数据格式是2022-12-09 19:31:52,索引要求日期时间格式精确到毫秒。一个field的设置是不能被修改的,如果要修改一个Field,那么应该重新按照新的mapping,建立一个index,然后将数据批量查询出来,重新用bulk api写入index中。

解决办法:对索引中的date类型字段的格式做自定义。

PUT my_index
{
  "mappings": {
    "properties": {
      "date": {
        "type":   "date",
        "format": "yyyy-MM-dd HH:mm:ss||yyyy-MM-dd||epoch_millis"
      }
    }
  }
}

设置模板的时候,可以预先针对性的配置字段:

 

"Out_params": {
                            "properties": {
                                "ROOT-BODY-RETURN_CODE": {
                                    "type": "keyword"
                                },
								"data--initiateDate-*": {
									"type":   "date",
									"format": "yyyy-MM-dd HH:mm:ss||yyyy-MM-dd||epoch_millis"
								}
                            }
                        },

================================================

报错一、插入模板unknown setting [index.lifecycle.name]

{ - 
  "error": { - 
    "root_cause": [ - 
      { - 
        "type": "illegal_argument_exception",
        "reason": "unknown setting [index.lifecycle.name] please check that any required plugins are installed, or check the breaking changes documentation for removed settings"
      }
    ],
    "type": "illegal_argument_exception",
    "reason": "unknown setting [index.lifecycle.name] please check that any required plugins are installed, or check the breaking changes documentation for removed settings"
  },
  "status": 400
}

分析:模板语句中的settings.index.lifecycle.name是当前os不支持的属性。

解决办法:删除掉settings.index.lifecycle.name结构体。

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值