如何通过nutch在hbase中添加额外的字段?
How to add extra field in hbase through nutch?
我正在编写抓取时的 nutch 插件。我正在对抓取的网页进行一些分析,并将结果存储在该网页对应的hbase中。我不确定如何添加额外的字段以及如何使用 nutch 将数据写入该字段。
如果您想在 Solr 中建立索引时添加其他字段::
如果附加字段的值是固定的(Static),那么可以使用Nutch的index-static插件。
它允许您添加多个字段及其内容。
第 1 步:
您首先需要在 nutch-site.xml
中启用 index.static 属性
第 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写插件
我正在编写抓取时的 nutch 插件。我正在对抓取的网页进行一些分析,并将结果存储在该网页对应的hbase中。我不确定如何添加额外的字段以及如何使用 nutch 将数据写入该字段。
如果您想在 Solr 中建立索引时添加其他字段::
如果附加字段的值是固定的(Static),那么可以使用Nutch的index-static插件。
它允许您添加多个字段及其内容。
第 1 步:
您首先需要在 nutch-site.xml
中启用 index.static 属性第 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写插件