summaryrefslogtreecommitdiff
path: root/source
diff options
context:
space:
mode:
authorluccioman <luccioman@users.noreply.github.com>2018-06-07 09:40:54 +0200
committerluccioman <luccioman@users.noreply.github.com>2018-06-07 15:20:37 +0200
commitde4ea95687d93fd203d439996204ca807869705b (patch)
tree5f0538f10a41d58f7190d659a8e115cd2f4070f6 /source
parentcea81871616f7dd7ecdf897516d47a6074f9267e (diff)
Consistently allow gzip compression of remote Solr responses
Was already enabled when requesting remote Solr with https or with authentication (as an external Solr index)
Diffstat (limited to 'source')
-rw-r--r--source/net/yacy/cora/federate/solr/instance/RemoteInstance.java6
1 files changed, 4 insertions, 2 deletions
diff --git a/source/net/yacy/cora/federate/solr/instance/RemoteInstance.java b/source/net/yacy/cora/federate/solr/instance/RemoteInstance.java
index 3eb4545fc..04de504e1 100644
--- a/source/net/yacy/cora/federate/solr/instance/RemoteInstance.java
+++ b/source/net/yacy/cora/federate/solr/instance/RemoteInstance.java
@@ -217,10 +217,12 @@ public class RemoteInstance implements SolrInstance {
/* Here we must trust self-signed certificates as most peers with SSL enabled use such certificates */
this.client = buildCustomHttpClient(timeout, u, solraccount, solrpw, host, true);
} else {
- /* Build a http client the Solr utils as in the HttpSolrClient constructor implementation.
- * The only difference is that the common connection manager is used and configured in the buildConnectionManager() function */
+ /* Build a http client using the Solr utils as in the HttpSolrClient constructor implementation.
+ * The main difference is that a shared connection manager is used (configured in the buildConnectionManager() function) */
final ModifiableSolrParams params = new ModifiableSolrParams();
params.set(HttpClientUtil.PROP_FOLLOW_REDIRECTS, false);
+ /* Accept gzip compression of responses to reduce network usage */
+ params.set(HttpClientUtil.PROP_ALLOW_COMPRESSION, true);
this.client = HttpClientUtil.createClient(params, CONNECTION_MANAGER);
if(this.client instanceof DefaultHttpClient && this.client.getParams() != null) {
/* Set the maximum time to get a connection from the shared connections pool */