我正在尝试使用 TikaEntityProcessor 来索引 .html 文件内容。不知何故,我无法正确获得它。我检查了错误日志并收到以下错误。
SEVERE: Full Import failed:java.lang.RuntimeException:org.apache.solr.handler.dataimport.DataImportHandlerException: Unable to load EntityProcessor implementation for entity:tika-test Processing Document # 1
at org.apache.solr.handler.dataimport.DocBuilder.execute(DocBuilder.java:273)
at org.apache.solr.handler.dataimport.DataImporter.doFullImport(DataImporter.java:382)
at org.apache.solr.handler.dataimport.DataImporter.runCmd(DataImporter.java:448)
at org.apache.solr.handler.dataimport.DataImporter$1.run(DataImporter.java:429)
Caused by: org.apache.solr.handler.dataimport.DataImportHandlerException: Unable to load EntityProcessor implementation for entity:tika-test Processing Document # 1
at org.apache.solr.handler.dataimport.DataImportHandlerException.wrapAndThrow(DataImportHandlerException.java:71)
at org.apache.solr.handler.dataimport.DocBuilder.getEntityProcessorWrapper(DocBuilder.java:697)
at org.apache.solr.handler.dataimport.DocBuilder.getEntityProcessorWrapper(DocBuilder.java:703)
at org.apache.solr.handler.dataimport.DocBuilder.execute(DocBuilder.java:215)
... 3 more
Caused by: java.lang.ClassNotFoundException: Unable to load TikaEntityProcessor or org.apache.solr.handler.dataimport.TikaEntityProcessor
at org.apache.solr.handler.dataimport.DocBuilder.loadClass(DocBuilder.java:899)
at org.apache.solr.handler.dataimport.DocBuilder.getEntityProcessorWrapper(DocBuilder.java:694)
... 5 more
Caused by: org.apache.solr.common.SolrException: Error loading class 'TikaEntityProcessor'
at org.apache.solr.core.SolrResourceLoader.findClass(SolrResourceLoader.java:436)
at org.apache.solr.handler.dataimport.DocBuilder.loadClass(DocBuilder.java:889)
... 6 more
Caused by: java.lang.ClassNotFoundException: TikaEntityProcessor
at java.net.URLClassLoader$1.run(URLClassLoader.java:217)
我的 data-config.xml 文件如下:
<dataConfig>
<dataSource type="BinFileDataSource" />
<document>
<entity name="f" processor="FileListEntityProcessor" baseDir="path/to/basedir/" fileName=".*html" recursive="true" rootEntity="true" dataSource="null">
<entity name="tika-test" processor="TikaEntityProcessor" url="path/tohtml/files/" format="text" onError="skip">
<field column="product_id" name="product_id" meta="true"/>
<field column="type" name="type" meta="true"/>
<field column="title" name="title" meta="true"/>
</entity>
</entity>
</document>
</dataConfig>
我在 solrconfig.xml 中添加了以下代码
<requestHandler name="/dataimport" class="org.apache.solr.handler.dataimport.DataImportHandler">
<lst name="defaults">
<str name="config">/path/to/data-config.xml</str>
</lst>
我保留了默认的 schema.xml 文件并在该文件中添加了以下代码。
<field name="product_id" type="string" indexed="true" stored="true"/>
<field name="title" type="string" indexed="true" stored="true"/>
<field name="type" type="string" indexed="true" stored="true"/>
谁能告诉我我在这里想念什么?或者为什么我会得到错误?以及它的解决方案是什么。