我是 Apache Solr 的新手,我想用它来索引 pdf 文件。到目前为止,我设法让它启动并运行,现在我可以搜索添加的 pdf 文件。
但是,我需要能够从结果中检索搜索到的文本。
我在默认的 solrconfig.xml 中找到了一个 xml 片段,这正是:
<requestHandler name="/update/extract" class="org.apache.solr.handler.extraction.ExtractingRequestHandler" startup="lazy">
<lst name="defaults">
<!-- All the main content goes into "text"... if you need to return
the extracted text or do highlighting, use a stored field. -->
<str name="fmap.content">text</str>
<str name="lowernames">true</str>
<str name="uprefix">ignored_</str>
<!-- capture link hrefs but ignore div attributes -->
<str name="captureAttr">true</str>
<str name="fmap.a">links</str>
<str name="fmap.div">ignored_</str>
</lst>
根据我从这里得到的信息(http://www.lucidimagination.com/Community/Hear-from-the-Experts/Articles/Content-Extraction-Tika),我想我必须在 schema.xml 中添加一个新字段(例如“内容”)已存储=“真”和索引=“真”。但是,我不确定如何准确地做到这一点?
任何帮助表示赞赏,谢谢