Apache Nutch is an extensible and scalable web crawler
- fix for NUTCH-901 Make index-more plug-in configurable
Chris Mattmann2bf54e7e6b84
diff --git a/CHANGES.txt b/CHANGES.txtindex 02b8e00e2..de75a2c3d 100644--- a/CHANGES.txt+++ b/CHANGES.txt@@ -2,6 +2,8 @@ Nutch Change LogRelease 2.0 - Current Development+* NUTCH-901 Make index-more plug-in configurable (Markus Jelsma via mattmann)+* NUTCH-862 HttpClient null pointer exception (Sebastian Nagel via ab)* NUTCH-904 "-resume" option is always processed as "false" in FetcherJobdiff --git a/conf/nutch-default.xml b/conf/nutch-default.xmlindex 4ebf58972..579ff14cf 100644--- a/conf/nutch-default.xml+++ b/conf/nutch-default.xml@@ -713,6 +713,19 @@</description></property>++<!-- moreindexingfilter plugin properties -->++<property>+ <name>moreIndexingFilter.indexMimeTypeParts</name>+ <value>true</value>+ <description>Determines whether the index-more plugin will split the mime-type+ in sub parts, this requires the type field to be multi valued. Set to true for backward+ compatibility. False will not split the mime-type.+ </description>+</property>++<!-- URL normalizer properties --><property>diff --git a/src/plugin/index-more/src/java/org/apache/nutch/indexer/more/MoreIndexingFilter.java b/src/plugin/index-more/src/java/org/apache/nutch/indexer/more/MoreIndexingFilter.javaindex 67c92c880..15bd28fc0 100644--- a/src/plugin/index-more/src/java/org/apache/nutch/indexer/more/MoreIndexingFilter.java+++ b/src/plugin/index-more/src/java/org/apache/nutch/indexer/more/MoreIndexingFilter.java@@ -199,10 +199,13 @@ public class MoreIndexingFilter implements IndexingFilter {doc.add("type", scontentType);- String[] parts = getParts(scontentType);+ // Check if we need to split the content type in sub parts+ if (conf.getBoolean("moreIndexingFilter.indexMimeTypeParts", true)) {+ String[] parts = getParts(contentType);- for (String part : parts) {- doc.add("type", part);+ for(String part: parts) {+ doc.add("type", part);+ }}// leave this for future improvement