Solr部分更新MultiValued的Date日期字段时报错及解决方案
2024-09-15 01:17:24
问题描述如标题。
异常信息如下:
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"/>
最新文章
- 2014中国黑客榜(beta版)
- Aufs与Devicemapper的关系
- Windows下配置Java开发环境
- Git基本命令(一)
- liunx 服务内存消耗100% 怎么处理
- 【Todo】Python字符编码学习
- 从客户端中检测到有潜在危险的Request.Form值的解决方法
- spring @Resource和@Autowired的区别
- Javascript获取最近若干个月
- Python疑问系列
- 【转】python3 发邮件实例(包括:文本、html、图片、附件、SSL、群邮件)
- Flask学习记录之MarkDown编辑文本
- C++程序设计实践指导1.13自然数集中找合数改写要求实现
- 2014百度之星预赛(第二场)——Best Financing
- 分布式架构--Dubbo项目实战学习文档
- 致 CODING 用户的元宵问候
- 20155324 《Java程序设计》实验四 Android开发基础
- 2、Flutter 填坑记录篇
- Bugku-CTF之点击一百万次
- 将hta包装为exe发布
热门文章
- Oracle监控用户索引使用情况,删除无用索引
- ASP.NET实现微信功能(1)(创建菜单,验证,给菜单添加事件)
- ASP.NET CMS模板培训教程
- 4.Java网络编程之TCP/UDP
- 11.struts2文件上传
- 开源网站.NETMVC+ Layui+SqlSugar+RestSharp
- 浅析String不可变性
- 【转】JS编码解码、C#编码解码
- 自己动手C#模拟电梯的运行V1.0
- 关于SQL Server 安装程序在运行 Windows Installer 文件时遇到错误