[lucene] 获取pdf文件的document时出错

jssay 2010-03-12
当我用pdfbox的LucenePDFDocument来获取Document实例时:
Document document  =  LucenePDFDocument.getDocument(fileName);


报出异常:

Exception in thread "main" java.lang.NoSuchFieldError: NOT_ANALYZED
at org.apache.pdfbox.searchengine.lucene.LucenePDFDocument.addKeywordField(LucenePDFDocument.java:170)
at org.apache.pdfbox.searchengine.lucene.LucenePDFDocument.convertDocument(LucenePDFDocument.java:257)
at org.apache.pdfbox.searchengine.lucene.LucenePDFDocument.getDocument(LucenePDFDocument.java:363)

我现在用的是pdfbox1.0以及lucene-core2.1.0,之前用pdfbox0.7.3和lucene-core2.0.0时报出Null Pointer错误,都是在同一个地方出的错.

我知道这个可能跟pdf的格式有关,因为有些pdf是可以的.但不知道如何解决这个问题,希望各位Lucene大师指点一二.
pjw0221 2010-03-13
pdfbox 1.0 用的lucene版本是2.4     你版本有问题。
jssay 2010-03-15
thanks, pjw0221. the problem has been solved.
Global site tag (gtag.js) - Google Analytics