0

我在 DIH 中使用 UpdateRequestProcessorChain 并得到数据未提交到索引的问题。我试图调试我的处理器并且它可以工作。完全导入命令的状态是:

<response>
<lst name="responseHeader">
    <int name="status">0</int>
    <int name="QTime">1</int>
</lst>
<lst name="initArgs">
    <lst name="defaults">
        <str name="update.processor">DataImportChain</str>
        <str name="config">data-config.xml</str>
    </lst>
</lst>
<str name="command">status</str>
<str name="status">idle</str>
<str name="importResponse"/>
<lst name="statusMessages">
    <str name="Total Requests made to DataSource">0</str>
    <str name="Total Rows Fetched">7</str>
    <str name="Total Documents Skipped">0</str>
    <str name="Full Dump Started">2012-04-26 17:47:44</str>
    <str name="">Indexing completed. Added/Updated: 6 documents. Deleted 0 documents.</str>
    <str name="Committed">2012-04-26 17:47:45</str>
    <str name="Optimized">2012-04-26 17:47:45</str>
    <str name="Total Documents Processed">6</str>
    <str name="Time taken ">0:0:1.174</str>
</lst>
<str name="WARNING">This response format is experimental.  It is likely to change in the future.</str>

但是 catalina.out 中没有信息表明调用了提交过程:

26.04.2012 17:47:44 org.apache.solr.handler.dataimport.DataImporter doFullImport
INFO: Starting Full Import
26.04.2012 17:47:44 org.apache.solr.core.SolrCore execute
INFO: [dev] webapp=/solr path=/dataimport params={clean=true&commit=true&command=full-import} status=0 QTime=20 
26.04.2012 17:47:44 org.apache.solr.handler.dataimport.SolrWriter readIndexerProperties
INFO: Read dataimport.properties
26.04.2012 17:47:45 org.apache.solr.handler.dataimport.XPathEntityProcessor initXpathReader
INFO: Using xslTransformer: com.sun.org.apache.xalan.internal.xsltc.trax.TransformerImpl
26.04.2012 17:47:45 org.apache.solr.handler.dataimport.DocBuilder finish
INFO: Import completed successfully
26.04.2012 17:47:45 org.apache.solr.handler.dataimport.SolrWriter readIndexerProperties
INFO: Read dataimport.properties
26.04.2012 17:47:45 org.apache.solr.handler.dataimport.SolrWriter persist
INFO: Wrote last indexed time to dataimport.properties
26.04.2012 17:47:45 org.apache.solr.handler.dataimport.DocBuilder execute
INFO: Time taken = 0:0:1.174

日志中没有任何错误。如果我在没有 UpdateRequestProcessorChain 的情况下使用 DIH,则提交没有问题。有人知道这里可能出了什么问题吗?

这是我的 solrconfig.xml 中的配置:

<requestHandler name="/dataimport" class="org.apache.solr.handler.dataimport.DataImportHandler">
    <lst name="defaults">
        <str name="update.processor">DataImportChain</str>
        <str name="config">data-config.xml</str>  
    </lst>
</requestHandler>

<updateRequestProcessorChain name="DataImportChain" >
    <processor class="my.package.MyProcessorFactory" />
</updateRequestProcessorChain>
4

1 回答 1

1

您在 中遗漏了一些基本处理器updateRequestProcessorChain,这就是为什么没有任何反应。试试这个配置:

<updateRequestProcessorChain name="DataImportChain" >
    <processor class="my.package.MyProcessorFactory" />
    <processor class="solr.RunUpdateProcessorFactory" />
    <processor class="solr.LogUpdateProcessorFactory" />
</updateRequestProcessorChain>

事实上,它RunUpdateProcessorFactory是在链中做“普通事情”的那个。如果你忘记了它,你正在预处理一些从未被索引的东西。

于 2012-05-01T08:39:31.830 回答