SOLR:索引失败。回滚所有更改。

发布于 2024-11-27 06:07:43 字数 2835 浏览 1 评论 0原文

有以下内容

<?xml version="1.0" encoding="UTF-8"?>
<dataConfig>
  <dataSource batchSize="-1" convertType="true" driver="com.mysql.jdbc.Driver" password="solrpw" url="jdbc:mysql://127.0.0.1/solrDB" user="solruser"/>
  <document name="items">
    <entity name="root" pk="id" preImportDeleteQuery="data_source:1" query="select a.id, a.body, a.headline  title ,a.date  datecreated, a.title_id ,t.name  publisher_name from article as a inner join title as t on t.id=a.title_id" transformer="TemplateTransformer" deltaImportQuery="select a.id, a.body, a.headline  title ,a.date  datecreated, a.title_id ,t.name  publisher_name from article as a inner join title as t on t.id=a.title_id where last_update_time > '${dataimporter.last_index_time}'" deltaQuery="select id from article where last_update_time > '${dataimporter.last_index_time}'">
      <field column="data_source" template="1"/>
      <field column="data_source_type" template="Jdbc"/>
      <field column="data_source_name" template="syndigate_solr"/>
    </entity>
  </document>
</dataConfig>

我在 dataconfig_1.xml和 dataimport_1.properties 中

#Tue Aug 02 06:53:21 UTC 2011
last_index_time=2011-08-02 06\:52\:51
root.last_index_time=2011-08-02 06\:52\:51

,现在每当我运行 deltaimport 时,

http://myip:8888/solr/collection1/dataimport_1?command=delta-import

我都会得到以下响应

<response>
<lst name="responseHeader">
<int name="status">0</int>
<int name="QTime">8</int>
</lst>
<lst name="initArgs">
<lst name="defaults">
<str name="config">dataconfig_1.xml</str>
</lst>
</lst>
<str name="command">delta-import</str>
<str name="status">idle</str>
<str name="importResponse"/>
<lst name="statusMessages">
<str name="Time Elapsed">0:0:1.552</str>
<str name="Total Requests made to DataSource">2</str>
<str name="Total Rows Fetched">18954</str>
<str name="Total Documents Processed">0</str>
<str name="Total Documents Skipped">0</str>
<str name="Delta Dump started">2011-08-02 09:35:52</str>
<str name="Identifying Delta">2011-08-02 09:35:52</str>
<str name="Deltas Obtained">2011-08-02 09:35:52</str>
<str name="Building documents">2011-08-02 09:35:52</str>
<str name="Total Changed Documents">18954</str>
<str name="">Indexing failed. Rolled back all changes.</str>
<str name="Rolledback">2011-08-02 09:35:52</str>
</lst>
<str name="WARNING">
This response format is experimental. It is likely to change in the future.
</str>
</response>

,知道我做错了什么吗? 感谢您的帮助

i have the following in dataconfig_1.xml

<?xml version="1.0" encoding="UTF-8"?>
<dataConfig>
  <dataSource batchSize="-1" convertType="true" driver="com.mysql.jdbc.Driver" password="solrpw" url="jdbc:mysql://127.0.0.1/solrDB" user="solruser"/>
  <document name="items">
    <entity name="root" pk="id" preImportDeleteQuery="data_source:1" query="select a.id, a.body, a.headline  title ,a.date  datecreated, a.title_id ,t.name  publisher_name from article as a inner join title as t on t.id=a.title_id" transformer="TemplateTransformer" deltaImportQuery="select a.id, a.body, a.headline  title ,a.date  datecreated, a.title_id ,t.name  publisher_name from article as a inner join title as t on t.id=a.title_id where last_update_time > '${dataimporter.last_index_time}'" deltaQuery="select id from article where last_update_time > '${dataimporter.last_index_time}'">
      <field column="data_source" template="1"/>
      <field column="data_source_type" template="Jdbc"/>
      <field column="data_source_name" template="syndigate_solr"/>
    </entity>
  </document>
</dataConfig>

and in dataimport_1.properties i have

#Tue Aug 02 06:53:21 UTC 2011
last_index_time=2011-08-02 06\:52\:51
root.last_index_time=2011-08-02 06\:52\:51

now whenever i run deltaimport

http://myip:8888/solr/collection1/dataimport_1?command=delta-import

i got the following response

<response>
<lst name="responseHeader">
<int name="status">0</int>
<int name="QTime">8</int>
</lst>
<lst name="initArgs">
<lst name="defaults">
<str name="config">dataconfig_1.xml</str>
</lst>
</lst>
<str name="command">delta-import</str>
<str name="status">idle</str>
<str name="importResponse"/>
<lst name="statusMessages">
<str name="Time Elapsed">0:0:1.552</str>
<str name="Total Requests made to DataSource">2</str>
<str name="Total Rows Fetched">18954</str>
<str name="Total Documents Processed">0</str>
<str name="Total Documents Skipped">0</str>
<str name="Delta Dump started">2011-08-02 09:35:52</str>
<str name="Identifying Delta">2011-08-02 09:35:52</str>
<str name="Deltas Obtained">2011-08-02 09:35:52</str>
<str name="Building documents">2011-08-02 09:35:52</str>
<str name="Total Changed Documents">18954</str>
<str name="">Indexing failed. Rolled back all changes.</str>
<str name="Rolledback">2011-08-02 09:35:52</str>
</lst>
<str name="WARNING">
This response format is experimental. It is likely to change in the future.
</str>
</response>

any idea of what i am doing wrong??
Thanks for your help

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

花海 2024-12-04 06:07:43

我调试 jdbc 导入错误的方法是使用 log4jdbc 库。我将在 data-config.xml 中创建一个新的数据源,

<dataSource name="logMe" driver="net.sf.log4jdbc.DriverSpy" user="myUserName" password="myPassword" type="JdbcDataSource" url="jdbc:log4jdbc:mysql://myServer:3306/myDB" />

并将所有实体设置为使用这个新的数据源。

然后我会运行导入。之后,我会查看名为 sql.log 的日志文件。在文件的底部,它通常会告诉我 jdbc 在哪里停止以及出现什么错误。

The way I go about debugging jdbc import errors is to use the log4jdbc library. I'd create a new data source like so in the data-config.xml

<dataSource name="logMe" driver="net.sf.log4jdbc.DriverSpy" user="myUserName" password="myPassword" type="JdbcDataSource" url="jdbc:log4jdbc:mysql://myServer:3306/myDB" />

And set all the entities to use this new datasource.

Then I'd run the import. Afterwards, I'd look inside the log file called sql.log. At the bottom of the file, it'd usually tell me where jdbc stopped and at what error.

青瓷清茶倾城歌 2024-12-04 06:07:43

另外,如果您从命令行运行 jetty 服务器,其日志记录将显示在控制台中。查找任何标记为“严重”或“错误”的内容,然后向下阅读到“由”行引起。

Also, if you're running the jetty server from the command line, its logging will appear in the console. Look for anything marked SEVERE or ERROR and then read down to the "caused by" line.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文