无法使用solr4配置Tika1.2 [英] unable to configure Tika1.2 with solr4

查看:129
本文介绍了无法使用solr4配置Tika1.2的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试使用TikaEntityProcessor来索引.html文件内容.不知何故我无法正确获得它.我已经检查了错误日志,并收到以下错误.

I am trying to use TikaEntityProcessor to index the .html file content. Somehow I am not able to get it correctly. I have checked the error log and I got the following error.

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文件如下:

My data-config.xml file is as follow:

<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中添加了以下代码

I have added following code in 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文件,并在该文件中添加了以下代码.

I have kept the default schema.xml file and added the following code in that file.

<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"/>

有人可以告诉我我在这里想念什么吗?还是为什么我会得到错误?这是什么解决方案.

can anyone please tell me what am I missing here? or why I am get the errors? and what's it's solution.

推荐答案

您需要为apache-solr-dataimporthandler-4.0,apache-solr-dataimporthandler- extras-4.0和apache-solr-添加jar(或路径) dist文件夹中的cell-4.o以及contrib文件夹中的相应文件.

You need to add the jars (or paths) for apache-solr-dataimporthandler-4.0, apache-solr-dataimporthandler- extras-4.0 and apache-solr-cell-4.o in the dist folder as well as corresponding files in the contrib folder.

这就是解决我的问题的方式.

that's how my problem is solved.

这篇关于无法使用solr4配置Tika1.2的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆