这些是我尝试让delta导入处理程序工作的确切步骤。如果我能提供更多信息以帮助告诉我。我真的花了整个星期五晚上和今天这个,我扔掉了。我哪里出错了?
将此行添加到solrconfig:
<requestHandler name="/dataimport" class="org.apache.solr.handler.dataimport.DataImportHandler">
<lst name="defaults">
<str name="config">/home/solr/data-config.xml</str>
</lst>
</requestHandler>
然后我的data-config.xml看起来像这样:
<dataConfig>
<dataSource type="FileDataSource" />
<document>
<entity
name="document"
processor="FileListEntityProcessor"
baseDir="/var/lib/data"
fileName=".*.xml$"
recursive="false"
rootEntity="false"
dataSource="null">
<entity
processor="XPathEntityProcessor"
url="${document.fileAbsolutePath}"
useSolrAddSchema="true"
stream="true">
</entity>
</entity>
</document>
</dataConfig>
然后在我的var / lib / data文件夹中,我有一个如下所示的data.xml文件:
<add>
<doc>
<field name="id">123</field>
<field name="description">This is my long description</field>
<field name="company">Google</field>
<field name="location_name">England</field>
<field name="date">2007-12-31 22:29:59</field>
<field name="source">Google</field>
<field name="url">www.google.com</field>
<field name="latlng">45.17614,45.17614</field>
</doc>
</add>
最后我运行了这个命令:
http://localhost:8080/solr/dataimport?command=delta-import&clean=false
我得到了这个结果(失败):
<response>
<lst name="responseHeader">
<int name="status">0</int>
<int name="QTime">1</int>
</lst>
<lst name="initArgs">
<lst name="defaults">
<str name="config">/home/solr/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="Time Elapsed">0:15:9.543</str>
<str name="Total Requests made to DataSource">0</str>
<str name="Total Rows Fetched">0</str>
<str name="Total Documents Processed">0</str>
<str name="Total Documents Skipped">0</str>
<str name="Delta Dump started">2012-11-17 17:32:56</str>
<str name="Identifying Delta">2012-11-17 17:32:56</str>
<str name="">Indexing failed. Rolled back all changes.</str>
<str name="Rolledback">2012-11-17 17:32:56</str>
</lst>
<str name="WARNING">
This response format is experimental. It is likely to change in the future.
</str>
</response>
编辑:这是tomcat.log所说的:
INFO: Starting Delta Import
Nov 18, 2012 12:48:46 PM org.apache.solr.core.SolrCore execute
INFO: [] webapp=/solr path=/dataimport params={clean=false&command=delta-import} status=0 QTime=1
Nov 18, 2012 12:48:46 PM org.apache.solr.handler.dataimport.SimplePropertiesWriter readIndexerProperties
WARNING: Unable to read: dataimport.properties
Nov 18, 2012 12:48:46 PM org.apache.solr.handler.dataimport.DocBuilder doDelta
INFO: Starting delta collection.
Nov 18, 2012 12:48:46 PM org.apache.solr.handler.dataimport.DocBuilder collectDelta
INFO: Running ModifiedRowKey() for Entity: 84430688679548
Nov 18, 2012 12:48:46 PM org.apache.solr.handler.dataimport.DocBuilder collectDelta
INFO: Completed ModifiedRowKey for Entity: 84430688679548 rows obtained : 0
Nov 18, 2012 12:48:46 PM org.apache.solr.handler.dataimport.DocBuilder collectDelta
INFO: Completed DeletedRowKey for Entity: 84430688679548 rows obtained : 0
Nov 18, 2012 12:48:46 PM org.apache.solr.handler.dataimport.DocBuilder collectDelta
INFO: Completed parentDeltaQuery for Entity: 84430688679548
Nov 18, 2012 12:48:46 PM org.apache.solr.handler.dataimport.DocBuilder collectDelta
INFO: Running ModifiedRowKey() for Entity: document
Nov 18, 2012 12:48:46 PM org.apache.solr.handler.dataimport.DocBuilder collectDelta
INFO: Completed ModifiedRowKey for Entity: document rows obtained : 0
Nov 18, 2012 12:48:46 PM org.apache.solr.handler.dataimport.DocBuilder collectDelta
INFO: Completed DeletedRowKey for Entity: document rows obtained : 0
Nov 18, 2012 12:48:46 PM org.apache.solr.handler.dataimport.DocBuilder collectDelta
INFO: Completed parentDeltaQuery for Entity: document
Nov 18, 2012 12:48:46 PM org.apache.solr.handler.dataimport.DocBuilder doDelta
INFO: Delta Import completed successfully
答案 0 :(得分:2)
查看Wiki:
唯一支持delta的EntityProcessor是SqlEntityProcessor! XPathEntityProcessor还没有实现它。所以,遗憾的是,目前还没有对XML的delta支持。