我正在使用基于 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