[ 
https://issues.apache.org/jira/browse/NUTCH-1259?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13193030#comment-13193030
 ] 

Markus Jelsma commented on NUTCH-1259:
--------------------------------------

A solution would be to prevent the type to be added just like what is already 
being done with the title field. Now, a reliable Content-Type value is added to 
the ParseMetaData.

{code}
                // populate Nutch metadata with Tika metadata
                String[] TikaMDNames = tikamd.names();
                for (String tikaMDName : TikaMDNames) {
                        if (tikaMDName.equalsIgnoreCase(Metadata.TITLE))
                                continue;

      // DO NOT ADD Content-Type FROM HTTP_HEADERS, ONLY ADD THE DETECTED TYPE 
SEE https://issues.apache.org/jira/browse/NUTCH-1259
       if (tikaMDName.equalsIgnoreCase(Metadata.CONTENT_TYPE))
        continue;

                        // TODO what if multivalued?
                        nutchMetadata.add(tikaMDName, tikamd.get(tikaMDName));
                }
    // Only add the detected TYPE
    nutchMetadata.add("Content-Type", mimeType);
{code}
                
> TikaParser should not add Content-Type from HTTP Headers to Nutch Metadata
> --------------------------------------------------------------------------
>
>                 Key: NUTCH-1259
>                 URL: https://issues.apache.org/jira/browse/NUTCH-1259
>             Project: Nutch
>          Issue Type: Bug
>          Components: parser
>    Affects Versions: 1.4
>            Reporter: Markus Jelsma
>            Assignee: Markus Jelsma
>             Fix For: 1.5
>
>
> The MIME-type detected by Tika's Detect() API is never added to a Parse's 
> ContentMetaData or ParseMetaData. Because of this bad Content-Types will end 
> up in the documents. 

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: 
https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

Reply via email to