You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@camel.apache.org by "Andrea Cosentino (JIRA)" <ji...@apache.org> on 2016/03/24 15:57:25 UTC
[jira] [Resolved] (CAMEL-9736) SolrComponent gets the wrong Content
Type
[ https://issues.apache.org/jira/browse/CAMEL-9736?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Andrea Cosentino resolved CAMEL-9736.
-------------------------------------
Resolution: Fixed
> SolrComponent gets the wrong Content Type
> -----------------------------------------
>
> Key: CAMEL-9736
> URL: https://issues.apache.org/jira/browse/CAMEL-9736
> Project: Camel
> Issue Type: Improvement
> Components: camel-solr
> Affects Versions: 2.16.2
> Environment: Linux
> Reporter: Mansour Al Akeel
> Assignee: Andrea Cosentino
> Priority: Minor
> Labels: content-type, indexing, solr
> Fix For: 2.18.0, 2.17.1
>
>
> Currently, there is no way to specify the content type. It's extracted automatically from the File in the body of the Message. This results in error when indexing a document. Setting Exchange.CONTENT_TYPE or Exchange.FILE_CONTENT_TYPE does not help.
> For example, neither of these would work, as the component ignores the header and reads the file type in SolrProducer:
> if (body instanceof File) {
> MimetypesFileTypeMap mimeTypesMap = new MimetypesFileTypeMap();
> String mimeType = mimeTypesMap.getContentType((File)body);
> ContentStreamUpdateRequest updateRequest = new
> ContentStreamUpdateRequest(getRequestHandler());
> updateRequest.addFile((File) body, mimeType);
> A simple solution could be to check if the Exchange.FILE_CONTENT_TYPE is set, before trying to extract if from mimeTypesMap.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)