2011-07-13 113 views

回答

1

Solr的細胞,又名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實現。

+0

我發現幾分鐘前,但我有一個錯誤:墳墓完全導入失敗:org.apache.solr.handler.dataimport.DataImportHandlerEx ception:沒有數據源:BIN可供實體:94600730275216處理文檔 ument#1我不知道爲什麼。 – bobosh

+0

但我已經配置了一個數據源 – bobosh

+0

你的問題是「這可能嗎?」,它是。請另外提問。 – opyate

相關問題