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

查看:234
本文介绍了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中的列名相同(区分大小写).如果没有,则在查询中重命名colmuns名称:

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

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

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

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

您错误地使用了field元素.请参见此处如何使用此元素:

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天全站免登陆