Solr : data import handler and solr cell

柔情痞子 提交于 2019-12-06 15:58:50

问题


Is it possible to index rich document (pdf, office)... with data import handler using solr cell.

I use solr 3.2.

Thanks.


回答1:


Solr Cell, aka ExtractingRequestHandler, uses Apache Tika behind the scenes, and the latter can easily be integrated into a 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>

This functionality was implemented in SOLR-1358.



来源:https://stackoverflow.com/questions/6676242/solr-data-import-handler-and-solr-cell

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!