Index: src/plugin/index-anchor/src/java/org/apache/nutch/indexer/anchor/AnchorIndexingFilter.java
===================================================================
--- src/plugin/index-anchor/src/java/org/apache/nutch/indexer/anchor/AnchorIndexingFilter.java	(revision 1145192)
+++ src/plugin/index-anchor/src/java/org/apache/nutch/indexer/anchor/AnchorIndexingFilter.java	(working copy)
@@ -16,6 +16,8 @@
  */
 package org.apache.nutch.indexer.anchor;
 
+import java.util.WeakHashMap;
+
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
 import org.apache.hadoop.conf.Configuration;
@@ -35,9 +37,13 @@
 
   public static final Log LOG = LogFactory.getLog(AnchorIndexingFilter.class);
   private Configuration conf;
+  private boolean deduplicate = false;
 
   public void setConf(Configuration conf) {
     this.conf = conf;
+
+    deduplicate = conf.getBoolean("anchorIndexingFilter.deduplicate", false);
+    LOG.info("Anchor deduplication is: " + (deduplicate ? "on" : "off"));
   }
 
   public Configuration getConf() {
@@ -49,8 +55,24 @@
 
     String[] anchors = (inlinks != null ? inlinks.getAnchors()
       : new String[0]);
+
+    // https://issues.apache.org/jira/browse/NUTCH-1037
+    WeakHashMap<String,Integer> map = new WeakHashMap<String,Integer>();
+
     for (int i = 0; i < anchors.length; i++) {
-      doc.add("anchor", anchors[i]);
+      if (deduplicate) {
+        // Check if already processed the current anchor
+        if (!map.containsKey(anchors[i].toLowerCase())) {
+          doc.add("anchor", anchors[i]);
+
+          // Add to map
+        map.put(anchors[i].toLowerCase(), 1);
+        } else {
+          LOG.warn("Not adding duplicate anchor: " + anchors[i]);
+        }
+      } else {
+        doc.add("anchor", anchors[i]);
+      }
     }
 
     return doc;
