2017-10-04 75 views
1

我在取時間寫了一個nutch插件。我正在對獲取的網頁進行一些分析,並將結果存儲在對應於網頁的hbase中。我不知道如何添加額外的字段以及如何使用nutch將數據寫入該字段。如何通過nutch在hbase中添加額外的字段?

+0

嘗試索引更新schema.xml! –

+0

你想添加額外的領域,而索引? –

+0

是否可以在hbase中添加額外的字段? – Rajeev

回答

1

如果你想增加額外的字段建立索引時Solr中::

如果固定的附加字段(靜態)的值,那麼你可以使用的Nutch的指數靜態插件。

它允許您添加一些字段及其內容。

第1步:

您首先需要啓用index.static財產Nutch的-site.xml中

第2步:

添加index.static財產

<property> 
<name>index.static</name> 
<value>first_field:value,second_field:value</value> 
<description> 
    Used by plugin index-static to adds fields with static data at indexing time. 
    You can specify a comma-separated list of fieldname:fieldcontent per Nutch job. 
    Each fieldcontent can have multiple values separated by space, e.g., 
    field1:value1.1 value1.2 value1.3,field2:value2.1 value2.2 ... 
    It can be useful when collections can't be created by URL patterns, 
    like in subcollection, but on a job-basis. 
    </description> 
</property> 

步驟3:

添加字段定義在schema.xml中

第4步:

啓用在plugin.includes

或者您可以按照https://wiki.apache.org/nutch/WritingPluginExample-1.2寫作插件

相關問題