zoukankan      html  css  js  c++  java
  • 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 Sep 14 01:48:38 CEST 2015'
    at org.apache.solr.util.DateFormatUtil.parseMath(DateFormatUtil.java:87)

    对应开源问题单:

    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"/>

    如果,您认为阅读这篇博客让您有些收获,不妨点击一下右下角的【推荐】。
    如果,您希望更容易地发现我的新博客,不妨点击一下左下角的【关注我】。
    如果,您对我的博客所讲述的内容有兴趣,请继续关注我的后续博客,我是【Arli】。

    本文版权归作者和博客园共有,欢迎转载,但未经作者同意必须保留此段声明,且在文章页面明显位置给出原文连接,否则保留追究法律责任的权利。

  • 相关阅读:
    出现System.web.mvc冲突的原因及解决方法CS0433
    看完此文还不懂NB-IoT,你就过来掐死我吧...
    html5调用手机陀螺仪实现方向辨识
    黑盒测试和白盒测试的区别
    CentOS7 下 keepalived 的安装和配置
    centos 下 mysql+keepalived实现双主自由切换
    MySQL 高可用性—keepalived+mysql双主(有详细步骤和全部配置项解释)
    备份VMware虚拟磁盘文件 移植到其他虚拟机
    Centos7 Mysql 双机热备实现数据库高可用
    CentOS7配置Mysql热备份
  • 原文地址:https://www.cnblogs.com/arli/p/6244468.html
Copyright © 2011-2022 走看看