Gal Nitzan wrote:

Hi Andrzej,

The value cannot be null is my message :)


:)

I'm guessing that you are using Fetcher in non-parsing mode, and then you run ParseSegment as a separate step, right?

Please try the attached patch.

--
Best regards,
Andrzej Bialecki     <><
___. ___ ___ ___ _ _   __________________________________
[__ || __|__/|__||\/|  Information Retrieval, Semantic Web
___|||__||  \|  ||  |  Embedded Unix, System Integration
http://www.sigram.com  Contact: info at sigram dot com


Index: ParseSegment.java
===================================================================
--- ParseSegment.java   (revision 367099)
+++ ParseSegment.java   (working copy)
@@ -58,9 +58,16 @@
       status = new ParseStatus(e);
     }
 
+    ContentProperties metadata = parse.getData().getMetadata();
     // compute the new signature
     byte[] signature = 
SignatureFactory.getSignature(getConf()).calculate(content, parse);
-    parse.getData().getMetadata().setProperty(Fetcher.SIGNATURE_KEY, 
StringUtil.toHexString(signature));
+    metadata.setProperty(Fetcher.SIGNATURE_KEY, 
StringUtil.toHexString(signature));
+    // copy segment name and score
+    String segmentName = 
content.getMetadata().getProperty(Fetcher.SEGMENT_NAME_KEY);
+    String score = content.getMetadata().getProperty(Fetcher.SCORE_KEY);
+    metadata.setProperty(Fetcher.SEGMENT_NAME_KEY, segmentName);
+    metadata.setProperty(Fetcher.SCORE_KEY, score);
+    
     if (status.isSuccess()) {
       output.collect(key, new ParseImpl(parse.getText(), parse.getData()));
     } else {

Reply via email to