使用 Solr 配置 Tika [英] Configuring Tika With Solr

查看:33
本文介绍了使用 Solr 配置 Tika的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我希望将丰富类型的文档(Pdf、Doc、rtf、txt)索引到 Solr 中.我找到了 Tika 作为解决方案.我在网上发了言,但没有找到任何文档/链接使其与 ExtractingRequestHandler 一起使用.

I am Looking to index Rich types documents(Pdf, Doc, rtf, txt) into Solr. I found Tika as a solution. I made a rant over the web but didn't found any Docs/links to make it work with ExtractingRequestHandler.

任何人都可以提供使用 ExtractingRequestHandler 配置 Tika 的分步方法.

Anyone can please provide step by step way to configure Tika with ExtractingRequestHandler.

提前致谢:)

推荐答案

检查 ExtractingRequestHandler 进行集成Solr 与 Tika.
Solr 提供内置的 tika.config,除非覆盖配置,否则您不需要定义它.
您可以使用 solrconfig.xml 中定义的默认配置

Check ExtractingRequestHandler for Integration of Solr with Tika.
Solr provides tika.config inbuilt and you would not need to define it unless overriding the config.
You can go with the default config as defined in the solrconfig.xml

<!-- Solr Cell Update Request Handler

   http://wiki.apache.org/solr/ExtractingRequestHandler 

-->
<requestHandler name="/update/extract" 
              startup="lazy"
              class="solr.extraction.ExtractingRequestHandler" >
<lst name="defaults">
  <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>
</requestHandler>

您可以使用这些命令将文件索引到带有附加元数据的 solr.

You can use the commands to index the files to solr with additional metadata.

curl "http://localhost:8983/solr/update/extract?literal.id=2&literal.title=Test&commit=true&fmap.content=text" -F "myfile=@1.pdf"

默认情况下,文件的内容被复制到内容字段并复制到文本,您可以覆盖设置.

By default the content of the files are copied to content field and copied over to text, you can override the settings.

这篇关于使用 Solr 配置 Tika的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆