Author: jnioche
Date: Tue Feb 14 14:11:38 2012
New Revision: 1243928
URL: http://svn.apache.org/viewvc?rev=1243928&view=rev
Log:
BugFix : NUTCH-1259 Store detected content type in crawldatum metadata
Modified:
nutch/trunk/src/java/org/apache/nutch/fetcher/Fetcher.java
Modified: nutch/trunk/src/java/org/apache/nutch/fetcher/Fetcher.java
URL:
http://svn.apache.org/viewvc/nutch/trunk/src/java/org/apache/nutch/fetcher/Fetcher.java?rev=1243928&r1=1243927&r2=1243928&view=diff
==============================================================================
--- nutch/trunk/src/java/org/apache/nutch/fetcher/Fetcher.java (original)
+++ nutch/trunk/src/java/org/apache/nutch/fetcher/Fetcher.java Tue Feb 14
14:11:38 2012
@@ -924,12 +924,14 @@ public class Fetcher extends Configured
datum.setStatus(status);
datum.setFetchTime(System.currentTimeMillis());
if (pstatus != null)
datum.getMetaData().put(Nutch.WRITABLE_PROTO_STATUS_KEY, pstatus);
- // store the guessed content type in the crawldatum
- if (content.getContentType() != null) datum.getMetaData().put(new
Text(Metadata.CONTENT_TYPE), new Text(content.getContentType()));
ParseResult parseResult = null;
if (content != null) {
Metadata metadata = content.getMetadata();
+
+ // store the guessed content type in the crawldatum
+ if (content.getContentType() != null) datum.getMetaData().put(new
Text(Metadata.CONTENT_TYPE), new Text(content.getContentType()));
+
// add segment to metadata
metadata.set(Nutch.SEGMENT_NAME_KEY, segmentName);
// add score to content metadata so that ParseSegment can pick it up.