当我运行“使用清洁完全导入”命令时,错误是“索引失败。回滚所有更改”
我的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>
答案 0 :(得分:1)
我在某个时间点仍然收到相同的错误消息。对我来说有以下原因:
确保数据库中列的名称与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
如果您可以分享其他相关数据和日志,我们可以为您提供更具体的信息。
祝你好运。