solr delta导入不与TikaEntityProcessor一起使用

时间:2013-12-16 08:09:26

标签: solr apache-tika

我正在尝试使用TikaEntityProcessor安排Delta-import。完全导入工作正常,但Delta-import没有更新任何东西。也没有错误。 显示了这么多服务器日志,我无法弄清楚出了什么问题:

121151 [qtp966396367-15] INFO  org.apache.solr.handler.dataimport.DocBuilder  û Starting delta collection.
121155 [qtp966396367-15] INFO  org.apache.solr.handler.dataimport.DocBuilder  û Running ModifiedRowKey() for Entity: message
121156 [qtp966396367-15] INFO  org.apache.solr.handler.dataimport.DocBuilder  û Completed ModifiedRowKey for Entity: message rows obtained : 0
121156 [qtp966396367-15] INFO  org.apache.solr.handler.dataimport.DocBuilder  û Completed DeletedRowKey for Entity: message rows obtained : 0
121156 [qtp966396367-15] INFO  org.apache.solr.handler.dataimport.DocBuilder  û Completed parentDeltaQuery for Entity: message
121156 [qtp966396367-15] INFO  org.apache.solr.handler.dataimport.DocBuilder  û Running ModifiedRowKey() for Entity: messages
121157 [qtp966396367-15] INFO  org.apache.solr.handler.dataimport.JdbcDataSource  û Creating a connection for entity messages with URL: jdbc:oracle:thin:@//172.16.29.92:1521/d11gr21
121176 [qtp966396367-15] INFO  org.apache.solr.handler.dataimport.JdbcDataSource  û Time taken for getConnection(): 19
121182 [qtp966396367-15] INFO  org.apache.solr.handler.dataimport.DocBuilder  û Completed ModifiedRowKey for Entity: messages rows obtained : 1
121182 [qtp966396367-15] INFO  org.apache.solr.handler.dataimport.DocBuilder  û Completed DeletedRowKey for Entity: messages rows obtained : 0

我的dataconfig.xml如下:

 <document>

  <entity name="messages" pk="BLOB_PK" transformer='DateFormatTransformer'
    query="select * from BLOB_TEST"
    deltaImportQuery="select * from BLOB_TEST where BLOB_PK='${dataimporter.delta.id}'"
    deltaQuery="select BLOB_PK from BLOB_TEST where to_char(last_modified,'YYYY-MM-DD HH24:MI:SS') &gt; '${dataimporter.last_index_time}' "
    dataSource="db">
   <field column ="BLOB_PK" name ="id" />
   <field column="last_modified"  dateTimeFormat="YYYY-MM-DD HH24:MI:SS" locale="en"    />
     <entity 
         name="message" 
         dataSource="dastream"
          processor="TikaEntityProcessor"
         url="message"
         dataField="messages.MESSAGE"
         format="text">

        <field column="text" name="mxMsg" blob="true" />
        </entity>
     </entity>

</document>

当我从Web客户端手动运行Delta导入时,状态显示如下:

"statusMessages": { "Total Requests made to DataSource": "4", "Total Rows Fetched": "3", "Total Documents Skipped": "0", "Delta Dump started": "2013-12-16 14:48:28", "Identifying Delta": "2013-12-16 14:48:28", "Deltas Obtained": "2013-12-16 14:48:28", "Building documents": "2013-12-16 14:48:28", "Total Changed Documents": "3", "Total Documents Processed": "0", "Time taken": "0:0:0.50" }

1 个答案:

答案 0 :(得分:0)

我能够让它发挥作用。 我不得不从data-config.xml中删除以下内容:

deltaImportQuery =“从BLOB_TEST中选择*,其中BLOB_PK ='$ {dataimporter.delta.id}

我没有$ {dataimporter.delta.id}的配置,所以可能是因为即使检测到正确的没有添加的行,也没有任何内容被编入索引。