摘要
针对Lucene默认只能分析并索引HTML和TXT文档的缺点。通过引入PDFBox和POI等开源工具实现对DOC、XLS、PPT和PDF等文档的文本抽取,然后利用Lucene索引这些提取出来的文本,将文本和文档其它信息添加到Lucene的Document对象。从而使Lucene可以分析并索引DOC、XLS、PPT和PDF等格式的文档,实验结果表明通过改进Lucene文本分析器可以极大提高Lucene检索的通用性。
This paper aims at the shortcomings of Lucene only analyzing and indexing HTML and TXT documents.It extracts the text from XLS,PPT,Doc and PDF documents by using open source tools such as POI and PDFBox.Then it indexes these extracted text with Lucene and encapsulate these information to Lucene Document object.So Lucene can analyze and index Doc,XLS,PPT and PDF documents.The experimental results show that it can greatly enhance retrieval adaptability by improving Lucene text parser.
出处
《信息技术》
2011年第10期62-64,共3页
Information Technology
基金
教育部特色专业建设点项目(TS11772)
数字媒体艺术专业"技术-艺术"培养体系的研究与实践项目(09BY64)
关键词
全文检索
文本分析
抽取
封装
full-text retrieval
text analyzing
extract
encapsulation