Solr:数据导入处理程序和solr单元格

时间:2011-07-13 08:38:04

标签: solr apache-tika dataimporthandler solr-cell

是否可以使用solr cell索引富文档(pdf,office)...和数据导入处理程序。

我使用solr 3.2。

感谢。

1 个答案:

答案 0 :(得分:1)

Solr Cell,又名ExtractingRequestHandler,在幕后使用Apache Tika,后者可以很容易地集成到DataImportHandler中:

<dataConfig>
 <!-- use any of type DataSource<InputStream> --> 
  <dataSource type="BinURLDataSource"/>
  <document>
   <!-- The value of format can be text|xml|html|none. this is the format in which the body is emited (the 'text' field) . The implicit field 'text' will have that format.
          default value is 'text'  (if not specified) . format="none" means body is not emited-->
    <entity processor="TikaEntityProcessor" tikaConfig="tikaconfig.xml" url="${some.var.goes.here}" format="text">
      <!--Do appropriate mapping here  meta="true" means it is a metadata field -->
      <field column="Author" meta="true" name="author"/>
      <field column="title" meta="true" name="docTitle"/>
      <!--'text' is an implicit field emited by TikaEntityProcessor . Map it appropriately-->
      <field column="text"/>
     </entity>
  <document>
</dataConfig>

此功能已在SOLR-1358中实施。