Solr's TikaEntityProcessor not working

≯℡__Kan透↙ 提交于 2019-12-10 18:13:35

问题


I'm trying to get Solr to index a database in which one column is a filename of a PDF document I'd like to index. My configuration looks like this:

<dataConfig>
 <dataSource name="ds-db" driver="com.mysql.jdbc.Driver" url="jdbc:mysql://localhost/document_db" user="user" password="password" readOnly="true"/>
 <dataSource name="ds-file" type="BinFileDataSource"/>
 <document name="documents">
   <entity name="document" dataSource="ds-db" query="select * from documents">
     <entity processor="TikaEntityProcessor" url="/some/path/${document.filename}" dataSource="ds-file" format="text">
       <field column="text" />
     </entity>
   </entity>
 </document>
</dataConfig>

I'm using Solr from trunk (as of last week). The import process completes without errors, and it picks up the columns from the database, but not the content from the PDF file. It is definitely trying to access the PDF file, for if I give it an incorrect path name, it complains. It doesn't seem to be attempting to index the PDF, though, as it completes in about 40ms, whereas if I import the PDF via the ExtractingRequestHandler, it takes about 11 seconds to index it.

I've also tried the tika example in example-DIH and that doesn't seem to index anything, either. Am I doing something wrong, or is this just not working yet?

I'm running Java 1.6.0_20 on OSX 10.6.3.

(I should note that I already posted this on the solr-user mailing list and didn't get an answer.)


回答1:


Someone on the solr-user mailing list had the answer: http://lucene.472066.n3.nabble.com/TikaEntityProcessor-not-working-tp856965p867572.html

Basically, there's a bug in Apache Tika that was introduced after version 0.6, and it is apparently still present in the 0.8 snapshot that is currently in Solr's trunk. Downloading Tika 0.6 (from http://archive.apache.org/dist/lucene/tika/) and copying tika-core-0.6.jar and tika-parsers-0.6.jar into the path fixed the issue.



来源:https://stackoverflow.com/questions/2953434/solrs-tikaentityprocessor-not-working

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!