您如何配置 Apache Nutch 2.3 以支持机器人元标记?

How do you configure Apache Nutch 2.3 to honour robots metatag?

我安装了 Nutch 2.3,以 HBase 作为后端,我 运行 抓取其中包括 Solr 和 Solr 重复数据删除的索引。

我最近注意到 Solr 索引包含不需要的网页。

为了让 Nutch 忽略这些网页,我设置了以下元标记:

<meta name="robots" content="noindex,follow"> 

我访问了apache nutch官方网站,它解释如下:

If you do not have permission to edit the /robots.txt file on your server, you can still tell robots not to index your pages or follow your links. The standard mechanism for this is the robots META tag

在网上搜索答案,我发现了在 nutch-site.xml 中设置 Protocol.CHECK_ROBOTS 或设置 protocol.plugin.check.robots 为 属性 的建议。 None 其中似乎有效。

当前 Nutch 2.3 忽略 noindex 规则,因此将内容索引到外部数据存储,即 Solr。

问题是如何配置 Nutch 2.3 以支持机器人元标记?

此外,如果 Nutch 2.3 之前配置为忽略机器人元标记,并且在之前的抓取周期中对该网页编制了索引。如果 robots 元标记的规则是正确的,这会导致页面在以后的抓取中从 Solr 索引中删除吗?

我创建了一个插件来解决 Apache Nutch 2.3 不遵守机器人元标记规则 noindex 的问题。 metarobots 插件强制 Nutch 在索引期间丢弃符合条件的文档。这可以防止符合条件的文档被索引到您的外部数据存储,即 Solr。

请注意:此插件会阻止包含机器人元标记规则 noindex 的文档的索引,它不会删除之前已索引到外部数据存储的任何文档.

Visit this link for instructions