fix for index import

pull/8/head
Michael Peter Christen 10 years ago
parent 34de1e8cbc
commit d0aff91f23

@ -178,12 +178,11 @@ public class SurrogateReader extends DefaultHandler implements Runnable {
private boolean isSolrDump() { private boolean isSolrDump() {
try { try {
if (this.inputStream.available() < 60) return false;
byte[] b = new byte[100]; byte[] b = new byte[100];
this.inputStream.read(b); this.inputStream.read(b);
try { try {
String s = UTF8.String(b); String s = UTF8.String(b);
if (s.contains("<response>") && s.contains("<result>")) { if ((s.contains("<response>") && s.contains("<result>")) || s.startsWith("<doc>")) {
this.inputStream.unread(b); this.inputStream.unread(b);
return true; return true;
} }

@ -1945,9 +1945,7 @@ public final class Switchboard extends serverSwitch {
InputStream is = null; InputStream is = null;
try { try {
is = new BufferedInputStream(new FileInputStream(infile)); is = new BufferedInputStream(new FileInputStream(infile));
if ( s.endsWith(".gz") ) { if (s.endsWith(".gz")) is = new GZIPInputStream(is, 65535);
is = new GZIPInputStream(is);
}
processSurrogate(is, infile.getName()); processSurrogate(is, infile.getName());
} catch (final IOException e ) { } catch (final IOException e ) {
ConcurrentLog.logException(e); ConcurrentLog.logException(e);

Loading…
Cancel
Save