solr 数据导入错误:索引失败.回滚所有更改 [英] solr dataimport error: Indexing failed. Rolled back all changes

查看:34
本文介绍了solr 数据导入错误:索引失败.回滚所有更改的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我运行带清理的完全导入"命令时,错误是索引失败.回滚所有更改"

When I run the "Full import with cleaning" command, error is "Indexing failed. Rolled back all changes"

我的数据导入配置文件:

My dataimport config file:

<dataConfig>
  <dataSource type="JdbcDataSource" name="ds-1" driver="com.mysql.jdbc.Driver" url="jdbc:mysql://my.ip/my_db" user="my_db_user" password="my_password" readOnly="True"/>
  <document> 
    <entity name="videos" pk="ID" transformer="TemplateTransformer" dataSource="ds-1" 
            query="SELECT * FROM videos LIMIT 100">
      <field column="id" name="unid" indexed="true" stored="true" />
      <field column="title" name="baslik" indexed="true" stored="true" />
      <field column="video_img" name="img" indexed="true" stored="true" />
    </entity>
  </document>
</dataConfig>

推荐答案

我在某个时间点不断收到相同的错误消息.对我来说,有以下原因:

I kept receiving the same error message at some point in time.For me there were the following reasons:

  • 错误的连接字符串.
  • 坏驱动程序 (com.mysql.jdbc.Driver)
  • 错误查询
  • 列到 solrfields 的错误映射(我认为这也可能是您的问题)

确保数据库中的列名与 SOLR 中的列名相同(区分大小写).如果没有重命名查询中的列名:

Make sure the name of the columns in the database is the same (case sensitive) as the name of the columns in SOLR. If not rename the colmuns name in the query:

select id as uniqueid, title as Tittle

或在您定义的实体中使用字段元素,如下所示:

or using the field element in the entity you defined like this:

<field column="ID" name="id" />

您使用的字段元素有误. 请在此处查看如何使用此元素:http://wiki.apache.org/solr/DataImportHandler#Configuration_in_data-config.xml

You are using the field element wrong. See here how you can use this element: http://wiki.apache.org/solr/DataImportHandler#Configuration_in_data-config.xml

如果您可以共享其他相关数据和日志,我们可以为您提供更具体的信息.

If you can share other relevant data and logs we can give you more specific information.

祝你好运.

这篇关于solr 数据导入错误:索引失败.回滚所有更改的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆