1

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

I use solr 3.2.

Thanks.

javanna
  • 59,145
  • 14
  • 144
  • 125
bobosh
  • 425
  • 5
  • 21

1 Answers1

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.

opyate
  • 5,388
  • 1
  • 37
  • 64
  • i have found few minutes ago but i have an error : GRAVE: Full Import failed:org.apache.solr.handler.dataimport.DataImportHandlerEx ception: No dataSource :bin available for entity :94600730275216 Processing Doc ument # 1. I don't know why. – bobosh Jul 13 '11 at 10:12
  • But i have configured a datasource – bobosh Jul 13 '11 at 10:24
  • Your question was "Is it possible?", and it is. Please ask a separate question. – opyate Jul 13 '11 at 10:28