【问题标题】:update index in Solr, error: required field in SolrSchema not found in DataConfig更新 Solr 中的索引,错误:在 DataConfig 中找不到 SolrSchema 中的必填字段
【发布时间】:2011-04-07 03:45:04
【问题描述】:

我正在尝试更新我的索引,但我不断收到错误:

org.apache.solr.handler.dataimport.DataImporter verifyWithSchema 信息:UPC 是 SolrSchema 中的必填字段。但不是 在 DataConfig 中找到在 DataConfig 中找到

我不明白它为什么抱怨,因为:

  1. 我第一次运行导入时,它运行良好,我唯一更改的是向 schema.xml 添加一些字段(列)
  2. 我正在查询的表确实有一个 UPC 列。这是我的 data-config.xml 的样子:

    <dataConfig>
      <dataSource type="JdbcDataSource" 
          driver="com.mysql.jdbc.Driver"
          url="jdbc:mysql://localhost:3306/product" 
          user="root" 
          password="some_password"/>
      <document>
        <entity name="product" 
           query="select * from productdetails">
        </entity>
      </document>
     </dataConfig>
    

但是,有趣的部分是导入在一秒钟前工作,但在重新导入时失败。我希望有人以前遇到过这个问题。如果没有,也许有人可以建议其他要检查的东西?

【问题讨论】:

  • 您是否两次都进行了完全导入?如果 solr 在您第二次运行时缺少必填字段,听起来您的内容或架构在两次执行之间发生了变化

标签: mysql indexing solr


【解决方案1】:

这样做的原因是,当 DataImportHandler 启动时,它会根据您加载的架构检查其配置。这不是错误,只是警告。要删除它,您必须在导入配置中添加一个特定字段,其名称与您的必填字段匹配。

这不是重新导入失败的原因,因为这只是一个警告。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2014-08-04
    • 2019-12-13
    • 2011-11-22
    • 1970-01-01
    • 1970-01-01
    • 2013-09-28
    • 1970-01-01
    • 2012-04-02
    相关资源
    最近更新 更多