【发布时间】:2010-12-17 14:52:33
【问题描述】:
我正在使用基于 Java 的 Nutch 网络搜索软件。为了防止在我的搜索查询结果中返回重复的(url)结果,我试图在运行 Nutch 爬虫索引我的 Intranet 时从被索引的 url 中删除(又名规范化)“jsessionid”的表达式。但是,我对 $NUTCH_HOME/conf/regex-normalize.xml 的修改(在运行爬网之前)似乎没有任何效果。
如何确保我的 regex-normalize.xml 配置正在用于我的爬网?还有,
在抓取/索引期间,什么正则表达式会成功地从 url 中删除/规范化 'jsessionid' 的表达式?
以下是我当前的regex-normalize.xml的内容:
<?xml version="1.0"?>
<regex-normalize>
<regex>
<pattern>(.*);jsessionid=(.*)$</pattern>
<substitution>$1</substitution>
</regex>
<regex>
<pattern>(.*);jsessionid=(.*)(\&|\&amp;)</pattern>
<substitution>$1$3</substitution>
</regex>
<regex>
<pattern>;jsessionid=(.*)</pattern>
<substitution></substitution>
</regex>
</regex-normalize>
这是我为运行(测试)“爬网”而发出的命令:
bin/nutch crawl urls -dir /tmp/test/crawl_test -depth 3 -topN 500
【问题讨论】:
标签: java lucene search-engine nutch web-crawler