Question

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>
Was it helpful?

Solution

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.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top