gpt4 book ai didi

tomcat - Solr Delta-import 什么都不做

转载 作者:行者123 更新时间:2023-11-28 22:22:13 28 4
gpt4 key购买 nike

我是 Solr 的新手,不明白为什么 Delta import 什么都不做,而 full import 工作正常。每当我运行 Delta-import 时,我都会得到相同的响应,但没有提到添加任何新文档。每当编辑/添加该行时,updated_at 列都存在并包含正确的时间戳

我是否遗漏了让 Delta 导入工作所需的东西?

http://domain.com:8080/solr/dataimport?command=delta-import 的输出

<response>
<lst name="responseHeader">
<int name="status">0</int>
<int name="QTime">104</int>
</lst>
<lst name="initArgs">
<lst name="defaults">
<str name="config">/usr/local/solr/conf/data-config.xml</str>
</lst>
</lst>
<str name="command">delta-import</str>
<str name="status">idle</str>
<str name="importResponse"/>
<lst name="statusMessages">
<str name="Total Requests made to DataSource">1</str>
<str name="Total Rows Fetched">0</str>
<str name="Total Documents Skipped">0</str>
<str name="Delta Dump started">2012-08-24 01:55:07</str>
<str name="Identifying Delta">2012-08-24 01:55:07</str>
<str name="Deltas Obtained">2012-08-24 01:55:07</str>
<str name="Building documents">2012-08-24 01:55:07</str>
<str name="Total Changed Documents">0</str>
<str name="Total Documents Processed">0</str>
<str name="Time taken">0:0:0.9</str>
</lst>
<str name="WARNING">
This response format is experimental. It is likely to change in the future.
</str>
</response>

data-config.xml

<dataConfig>

<dataSource
name="mysql"
driver="com.mysql.jdbc.Driver"
url="jdbc:mysql://localhost/mysite"
user="myuser"
password="mypassword" />

<document>
<entity
name="posts"
datasource="mysql"
query="select id, title, description from posts"
deltaQuery="select id from posts where updated_at > '${dataimporter.last_index_time}'"
deltaImportQuery="select id, title, description from posts where id='${dataimporter.delta.id}'">
</entity>
<field column="id" name="id" indexed="true" stored="true" />
<field column="title" name="title" indexed="true" stored="true" />
<field column="description" name="description" indexed="true" stored="true" />
</document>

</dataConfig>

最佳答案

尝试改变文档的结构,用实体元素包围字段元素并添加一个主键属性哟实体:

<entity 
name="posts"
pk="id"
datasource="mysql"
query="select id, title, description from posts"
deltaQuery="select id from posts where updated_at > '${dataimporter.last_index_time}'"
deltaImportQuery="select id, title, description from posts where id='${dataimporter.delta.id}'">
<field column="id" name="id" indexed="true" stored="true" />
<field column="title" name="title" indexed="true" stored="true" />
<field column="description" name="description" indexed="true" stored="true" />
</entity>

关于tomcat - Solr Delta-import 什么都不做,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/12102316/

28 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com