Solr Delta导入不起任何作用



我是Solr的新手,不明白为什么增量导入什么都不做,而完全导入可以正常工作。每当我运行Delta导入时,我都会得到相同的响应,其中没有提到添加任何新文档。updated_at列存在,并且在编辑/添加该行时包含正确的timestamp

我是不是错过了让德尔塔进口发挥作用所需的一些东西?

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>

数据配置.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>

最新更新