2011-11-22 165 views
1

當我運行命令「和清潔全進口」,錯誤是「索引失敗回滾所有更改。」solr dataimport錯誤:索引失敗。回滾所有更改

我dataimport配置文件:

<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> 
+2

你也可以提供堆棧跟蹤嗎? – jpountz

+0

恐怕我們實際上無法幫到你,我們需要一些更多的信息 – javanna

回答

1

我不停地收到相同錯誤消息在某些時間點。對我來說有以下原因:

  • 錯誤的連接字符串。
  • 壞驅動程序(com.mysql.jdbc.Driver)
  • 壞查詢列
  • 壞映射solrfields(我想可能是你的問題太)

確保名數據庫中的列與SOLR中的列的名稱相同(區分大小寫)。如果查詢不重命名colmuns名稱:

select id as uniqueid, title as Tittle 

或實體使用字段元素你這樣定義的:

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

您使用的是場錯誤的元素。在這裏看到你可以如何使用這個元素:http://wiki.apache.org/solr/DataImportHandler#Configuration_in_data-config.xml

如果你可以分享其他相關的數據和日誌,我們可以給你更具體的信息。

祝你好運。

+0

壞的驅動程序(com.mysql.jdbc.Driver)的可能性是真的。謝謝。 –