mirror of
https://github.com/honeymoose/OpenSearch.git
synced 2025-02-26 14:54:56 +00:00
Upgrade Tika to 1.7
Closes #94. (cherry picked from commit 0ab38f3) (cherry picked from commit 96c7bb1)
This commit is contained in:
parent
931be57da9
commit
ec59d381b8
3
pom.xml
3
pom.xml
@ -89,8 +89,9 @@
|
|||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.apache.tika</groupId>
|
<groupId>org.apache.tika</groupId>
|
||||||
<artifactId>tika-parsers</artifactId>
|
<artifactId>tika-parsers</artifactId>
|
||||||
<version>1.5</version>
|
<version>1.7</version>
|
||||||
<exclusions>
|
<exclusions>
|
||||||
|
<!-- Not Apache2 License compatible -->
|
||||||
<exclusion>
|
<exclusion>
|
||||||
<groupId>edu.ucar</groupId>
|
<groupId>edu.ucar</groupId>
|
||||||
<artifactId>netcdf</artifactId>
|
<artifactId>netcdf</artifactId>
|
||||||
|
@ -455,6 +455,10 @@ public class AttachmentMapper extends AbstractFieldMapper<Object> {
|
|||||||
// 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 BytesStreamInput(content, false), metadata, indexedChars);
|
parsedContent = tika().parseToString(new BytesStreamInput(content, false), metadata, indexedChars);
|
||||||
} catch (Throwable e) {
|
} catch (Throwable e) {
|
||||||
|
// It could happen that Tika adds a System property `sun.font.fontmanager` which should not happen
|
||||||
|
// TODO Remove when this will be fixed in Tika. See https://issues.apache.org/jira/browse/TIKA-1548
|
||||||
|
System.clearProperty("sun.font.fontmanager");
|
||||||
|
|
||||||
// #18: we could ignore errors when Tika does not parse data
|
// #18: we could ignore errors when Tika does not parse data
|
||||||
if (!ignoreErrors) {
|
if (!ignoreErrors) {
|
||||||
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);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user