From d0aff91f233d8e6ad62dad38b2f26c74a2b4bea1 Mon Sep 17 00:00:00 2001 From: Michael Peter Christen Date: Mon, 1 Jun 2015 01:56:09 +0200 Subject: [PATCH] fix for index import --- source/net/yacy/document/content/SurrogateReader.java | 3 +-- source/net/yacy/search/Switchboard.java | 4 +--- 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/source/net/yacy/document/content/SurrogateReader.java b/source/net/yacy/document/content/SurrogateReader.java index 0bb47b8f3..a24f77678 100644 --- a/source/net/yacy/document/content/SurrogateReader.java +++ b/source/net/yacy/document/content/SurrogateReader.java @@ -178,12 +178,11 @@ public class SurrogateReader extends DefaultHandler implements Runnable { private boolean isSolrDump() { try { - if (this.inputStream.available() < 60) return false; byte[] b = new byte[100]; this.inputStream.read(b); try { String s = UTF8.String(b); - if (s.contains("") && s.contains("")) { + if ((s.contains("") && s.contains("")) || s.startsWith("")) { this.inputStream.unread(b); return true; } diff --git a/source/net/yacy/search/Switchboard.java b/source/net/yacy/search/Switchboard.java index bae47c53f..4d9464ed0 100644 --- a/source/net/yacy/search/Switchboard.java +++ b/source/net/yacy/search/Switchboard.java @@ -1945,9 +1945,7 @@ public final class Switchboard extends serverSwitch { InputStream is = null; try { is = new BufferedInputStream(new FileInputStream(infile)); - if ( s.endsWith(".gz") ) { - is = new GZIPInputStream(is); - } + if (s.endsWith(".gz")) is = new GZIPInputStream(is, 65535); processSurrogate(is, infile.getName()); } catch (final IOException e ) { ConcurrentLog.logException(e);