Mapper 1.7.0 does not work with elasticsearch 0.90.3

FastByteArrayInputStream has been removed in 0.90.3.
Closes #34.
This commit is contained in:
David Pilato 2013-08-07 09:47:12 +02:00
parent 690779cf2f
commit d054f9a1e7
3 changed files with 5 additions and 5 deletions

View File

@ -8,9 +8,9 @@ In order to install the plugin, simply run: `bin/plugin -install elasticsearch/e
------------------------------------------------------ ------------------------------------------------------
| Attachment Mapper Plugin | ElasticSearch | Tika | | Attachment Mapper Plugin | ElasticSearch | Tika |
------------------------------------------------------ ------------------------------------------------------
| master | 0.90 -> master | 1.2 | | master | 0.90.3 -> master | 1.2 |
------------------------------------------------------ ------------------------------------------------------
| 1.7.0 | 0.90 -> master | 1.2 | | 1.7.0 | 0.90 -> 0.90.2 | 1.2 |
------------------------------------------------------ ------------------------------------------------------
| 1.6.0 | 0.19 -> 0.20 | 1.2 | | 1.6.0 | 0.19 -> 0.20 | 1.2 |
------------------------------------------------------ ------------------------------------------------------

View File

@ -30,7 +30,7 @@
</parent> </parent>
<properties> <properties>
<elasticsearch.version>0.90.0.Beta1</elasticsearch.version> <elasticsearch.version>0.90.3</elasticsearch.version>
</properties> </properties>
<repositories> <repositories>

View File

@ -21,7 +21,7 @@ package org.elasticsearch.index.mapper.attachment;
import org.apache.tika.exception.TikaException; import org.apache.tika.exception.TikaException;
import org.apache.tika.metadata.Metadata; import org.apache.tika.metadata.Metadata;
import org.elasticsearch.common.io.FastByteArrayInputStream; import org.elasticsearch.common.io.stream.BytesStreamInput;
import org.elasticsearch.common.xcontent.XContentBuilder; import org.elasticsearch.common.xcontent.XContentBuilder;
import org.elasticsearch.common.xcontent.XContentParser; import org.elasticsearch.common.xcontent.XContentParser;
import org.elasticsearch.index.mapper.*; import org.elasticsearch.index.mapper.*;
@ -311,7 +311,7 @@ public class AttachmentMapper implements Mapper {
String parsedContent; String parsedContent;
try { try {
// Set the maximum length of strings returned by the parseToString method, -1 sets no limit // Set the maximum length of strings returned by the parseToString method, -1 sets no limit
parsedContent = tika().parseToString(new FastByteArrayInputStream(content), metadata, indexedChars); parsedContent = tika().parseToString(new BytesStreamInput(content, false), metadata, indexedChars);
} catch (TikaException e) { } catch (TikaException e) {
throw new MapperParsingException("Failed to extract [" + indexedChars + "] characters of text for [" + name + "]", e); throw new MapperParsingException("Failed to extract [" + indexedChars + "] characters of text for [" + name + "]", e);
} }