Skip to content

armgit / nutch

Public Imported from GitHub
0

Apache Nutch is an extensible and scalable web crawler

NUTCH-332: fix the problem of doubling scores caused by links pointing to the current page (e.g. anchors).

Andrzej Bialecki9daa5f977eab
diff --git a/CHANGES.txt b/CHANGES.txt
index 116eec5a2..43442ad29 100644
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@ -29,6 +29,9 @@ Unreleased changes (0.9-dev)
10. NUTCH-367 - DistributedSearch thown ClassCastException (siren)
+11. NUTCH-332 - Fix the problem of doubling scores caused by links pointing
+ to the current page (e.g. anchors). (Stefan Groschupf via ab)
+
Release 0.8 - 2006-07-25
diff --git a/src/java/org/apache/nutch/parse/ParseOutputFormat.java b/src/java/org/apache/nutch/parse/ParseOutputFormat.java
index 9955ea011..f89896f7f 100644
--- a/src/java/org/apache/nutch/parse/ParseOutputFormat.java
+++ b/src/java/org/apache/nutch/parse/ParseOutputFormat.java
@@ -121,6 +121,8 @@ public class ParseOutputFormat implements OutputFormat {
} catch (Exception e) {
toUrl = null;
}
+ // ignore links to self (or anchors within the page)
+ if (fromUrl.equals(toUrl)) toUrl = null;
if (toUrl != null) validCount++;
toUrls[i] = toUrl;
}