Skip to content

armgit / nutch

Public Imported from GitHub
0

Apache Nutch is an extensible and scalable web crawler

No more NullPointerException while logging the doc language if none

Jerome Charron8dda2fc6f98a
diff --git a/src/java/org/apache/nutch/indexer/IndexSegment.java b/src/java/org/apache/nutch/indexer/IndexSegment.java
index 6008f46e0..5437a46e4 100644
--- a/src/java/org/apache/nutch/indexer/IndexSegment.java
+++ b/src/java/org/apache/nutch/indexer/IndexSegment.java
@@ -145,8 +145,9 @@ public class IndexSegment {
// add the document to the index
NutchAnalyzer analyzer = AnalyzerFactory.get(doc.get("lang"));
- LOG.info(" Indexing [" + doc.getField("url").stringValue() +
- "] with analyzer " + analyzer + " (" + doc.getField("lang").stringValue() + ")");
+ LOG.info(" Indexing [" + doc.getField("url").stringValue() + "]" +
+ " with analyzer " + analyzer +
+ " (" + doc.get("lang") + ")");
//LOG.info(" Doc is " + doc);
writer.addDocument(doc, analyzer);
if (count > 0 && count % LOG_STEP == 0) {