Distributed Peer-to-Peer Web Search Engine and Intranet Search Appliance
Java decentralizedintranet-searchintranet-search-enginep2pp2p-networkprivacyprivacy-protectionsearch-enginesearchenginewebweb-search-enginewebsearchwebseearch-engine
added special handling of the BinaryResponseWriter in the solr interface which makes it possible to use solrj with the javabin format which is much better (compressed, no xml overhead, java object streams) and faster. Furthermore, this enables the 'shards' option in the solr interface which connects one solr (YaCy) to another solr (YaCy) ad-hoc.
orbiter1ca4b9612cf5
diff --git a/htroot/solr/select.java b/htroot/solr/select.javaindex d9a3ae61d..51288ec14 100644--- a/htroot/solr/select.java+++ b/htroot/solr/select.java@@ -58,6 +58,7 @@ import org.apache.solr.common.util.NamedList;import org.apache.solr.core.SolrCore;import org.apache.solr.request.SolrQueryRequest;import org.apache.solr.request.SolrRequestInfo;+import org.apache.solr.response.BinaryResponseWriter;import org.apache.solr.response.QueryResponseWriter;import org.apache.solr.response.ResultContext;import org.apache.solr.response.SolrQueryResponse;@@ -228,15 +229,25 @@ public class select {}// write the result directly to the output stream- Writer ow = new FastWriter(new OutputStreamWriter(out, UTF8.charset));- try {- responseWriter.write(ow, req, response);- ow.flush();- } catch (final IOException e1) {- } finally {- req.close();- SolrRequestInfo.clearRequestInfo();- try {ow.close();} catch (final IOException e1) {}+ if (responseWriter instanceof BinaryResponseWriter) {+ try {+ ((BinaryResponseWriter) responseWriter).write(out, req, response);+ } catch (final IOException e1) {+ } finally {+ req.close();+ SolrRequestInfo.clearRequestInfo();+ }+ } else {+ Writer ow = new FastWriter(new OutputStreamWriter(out, UTF8.charset));+ try {+ responseWriter.write(ow, req, response);+ ow.flush();+ } catch (final IOException e1) {+ } finally {+ req.close();+ SolrRequestInfo.clearRequestInfo();+ try {ow.close();} catch (final IOException e1) {}+ }}// log result