Solr部分更新MultiValued的Date日期字段时报错及解决方案
问题描述如标题。
异常信息如下:
Result
Caused by: org.apache.solr.common.SolrException: Invalid Date String:'Mon Sep 14 01:48:38 CEST 2015'
at org.apache.solr.util.DateFormatUtil.parseMath(DateFormatUtil.java:)
对应开源问题单:
https://issues.apache.org/jira/browse/SOLR-8050
solr5.4 solr6.0版本修复了该问题。而cloudera的社区版还存在该问题。
规避思路:虽然日期字段不支持部分更新,可以先转换为string字段,再通过copyField到日期字段。
<!--customer_doc-->
<field name="phone_in_history_date_china_str" type="string" indexed="false" stored="true" multiValued="true" docValues="true"/>
<field name="phone_out_history_date_china_str" type="string" indexed="false" stored="true" multiValued="true" docValues="true"/>
<field name="caller_history_date_china_str" type="string" indexed="false" stored="true" multiValued="true" docValues="true"/>
<field name="history_record_date_china_str" type="string" indexed="false" stored="true" multiValued="true" docValues="true"/>
<field name="phone_in_history_date_china" type="tdate" indexed="false" stored="true" multiValued="true" docValues="true"/>
<field name="phone_out_history_date_china" type="tdate" indexed="false" stored="true" multiValued="true" docValues="true"/>
<field name="caller_history_date_china" type="tdate" indexed="false" stored="true" multiValued="true" docValues="true"/>
<field name="history_record_date_china" type="tdate" indexed="false" stored="true" multiValued="true" docValues="true"/>
copyField:
<copyField source="phone_in_history_date_china_str" dest="phone_in_history_date_china"/>
<copyField source="phone_out_history_date_china_str" dest="phone_out_history_date_china"/>
<copyField source="caller_history_date_china_str" dest="caller_history_date_china"/>
<copyField source="history_record_date_china_str" dest="history_record_date_china"/>
Solr部分更新MultiValued的Date日期字段时报错及解决方案的更多相关文章
- Solr部分更新MultiValued的Date日期字段时报错及解决方案:Invalid Date String:'Mon Sep 14 01:48:38 CST 2015'
问题描述如标题. 异常信息如下: Result Caused by: org.apache.solr.common.SolrException: Invalid Date String:'Mon Se ...
- sql server中NULL导入decimal字段时报错
sql server中NULL导入decimal字段时报错 在导入CSV文件时,如果decimal字段为null值,导致文本文件入库时失败. 错误现象 构造例子 新建一张表,包含decimal字段. ...
- OverflowError:django signed integer is greater than maximum 数据库日期字段相关错
使用django中的默认数据库sqlite3, 在pycharm中录入日期字段相关信息结果出现问题 在保存的时候如图 直接在界面选择的日期变成了时间戳, 并且在获取数据的时候报错 经过查询之后(舔大佬 ...
- struts2 谷歌浏览器保存date类型数据时报错
一同事发现一个bug,在chrome上保存一个表单时,后台会报错,而在firefox上则可以正常保存. 奇怪的地方在于,后端的程序是同一个,而在浏览器上查看请求header时,两个浏览器对应的字段内容 ...
- SpringMVC解决@ResponseBody返回Json的Date日期类型的转换问题
在做项目的时候,发现后台把Date类型的属性以json字符串的形式返回,前台拿不到转换后的日期格式,始终响应回去的都是long类型时间戳. 查阅资料之后找到解决方法: 方法一(在springmvc的x ...
- mysql更新表中日期字段时间
DATE_ADD和DATE_SUB函数可以用INTERVAL关键字标识的时间间隔进行加减操作,类似于PHP中的strtotime函数. 1.更新表中有效期valid_time字段值都增加一天 UPDA ...
- 如何使用 t-sql 更新数据库中日期字段的部分数据(年?月?日?时?分?秒?)
嗯,从网上找到了一些内容,综合利用了sql server的一些内置方法 首先是 convert 方法:https://msdn.microsoft.com/zh-cn/library/ms187928 ...
- ORACLE中date类型字段的处理
(1)在英文版本的ORACLE中默认日期格式为'DD-MON-YY',例如'01-JAN-98' 在汉化的中文版本中ORACLE默认日期格式为'日-月-年',例如'21-8月-2003'或'21-8月 ...
- Oracle查询日期字段是否包含时分秒 TRUNC() 函数
可以使用 ORACLE TRUNC()函数 来进行判断 表 A 日期字段 datetime 部分数据带时分秒,部分数据没有时分秒 select * from A where datetime = TR ...
随机推荐
- 1Z0-053 争议题目解析683
1Z0-053 争议题目解析683 考试科目:1Z0-053 题库版本:V13.02 题库中原题为: 683.Your production database it functional on the ...
- iOS_常用C语言函数
一.随机数: 1.rand(); 范围: 0-无穷大. 特点: 仅第一次随机,其他次都是和第一次相同.常用于调试. 返回值: long 实例: int ...
- CompoundButton.OnCheckedChangeListener与RadioGroup.OnCheckedChangeListener冲突
当RadioGroup与CompoundButton同时存在且都要监听事件时CompoundButton.OnCheckedChangeListener与RadioGroup.OnCheckedCha ...
- js构建ui的统一异常处理方案(二)
上一篇文章,我分析了同步代码做异常处理是基于责任链模式,而通过try.catch等语句可以很容易地实现这种责任链模式.但是如果是异步调用,我们无法直接通过try.catch语句实现责任链模式,并且通过 ...
- Apworks框架实战(三):单元测试与持续集成
虽然这部分内容并没有过多地讨论Apworks框架的使用,但这部分内容非常重要,它与Apworks框架本身的设计紧密相关,也是进一步了解Apworks框架设计的必修课. 单元测试与持续集成概述 在敏捷开 ...
- Openfire 4.1.0
http://www.igniterealtime.org/downloads/index.jsp 服务器端口 接口 端口 类型 描述 所有的地址 5222 客户端到服务器 客户端使用标准端口连接 ...
- jQuery弹出深色系层菜单
低调奢华jQuery弹出层菜单,使用新版的jQuery库,兼容多种浏览器.Demo展示: http://hovertree.com/texiao/layer/3/ 本特效可以作为网站的引导页,使用jQ ...
- ListView灵活的用法
以下是示例的效果图: WinForm的ListView控件是可以分组显示的,还可排序. 可以把ListView的View属性设置为Details 完整项目请到下面网址查找下载 http://hover ...
- 服务器Config文件不能查看的问题
由于某种需求,需要从IIS发布的服务中下载扩展名为config的文件,但是发布文件后,在浏览器无法查看文件.根据反馈的的错误提示,大致说config属于配置文件,处于安全考虑,不能随便浏览. 如果 ...
- 增加线程异步发送消息的方法二(Runnable)
//获取当前时间:毫秒 long a = System.currentTimeMillis(); System.out.println("a :" + a); try { //更改 ...