solr dataimport error: Indexing failed. Rolled back all changes

北城余情 提交于 2019-12-04 05:30:33

问题


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>

回答1:


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

  • bad connection string.
  • Bad driver (com.mysql.jdbc.Driver)
  • bad query
  • bad mapping of columns to solrfields ( I think it might be your problem too)

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

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.

Good luck.



来源:https://stackoverflow.com/questions/8234598/solr-dataimport-error-indexing-failed-rolled-back-all-changes

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!