【发布时间】:2011-06-24 07:56:42
【问题描述】:
我是 Apache Solr 的新手,我想用它来索引 pdf 文件。到目前为止,我设法启动并运行它,现在我可以搜索添加的 pdf 文件。
但是,我需要能够从结果中检索搜索到的文本。
我在默认的 solrconfig.xml 中找到了一个 xml sn-p,与此有关:
<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),我想我必须在架构中添加一个新字段.xml(例如“内容”)已存储=“真”和索引=“真”。但是,我不确定如何准确地做到这一点?
感谢任何帮助,谢谢
【问题讨论】:
-
嗯,我似乎已经成功了,我将“text”字段的“stored”属性设置为“true”。
-
奇怪的事实:无论查询如何,结果总是包含索引 pdf 中的邮件地址?
标签: apache cell solr apache-tika