开发者

Solr ExtractingRequestHandler giving empty content for pdf documents

I am using ExtractingRequestHandler in Solr for getting document content and index it. It works fine for all Microsoft Documents, but for PDFs, the content being extracted is empty. I have also tried the extractOnly=true with curl, and that also return开发者_高级运维s just the empty body.

I have used TIKA independently on the same documents and that extracts content just fine. The difference is when doing independently I am using BodyContentHander that comes with Tika instead of SolrContentHandler which is used by Solr. Has anybody seen this?

I would really rather let Solr handle it than me using Tika to extract content outside of Solr.


I just dealt with this problem for hours before figuring it out -- I was opening my PDFs in an non-binary mode, and feeding them to solr only up to the first EOF character in the file. Solr will still extract the metadata from the file (as it appears in the header of the PDF), but will return an empty body tag in its response.

This may not apply to the original poster, but it may really help someone else from wasting hours of their life.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜