manifoldcf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kwri...@apache.org
Subject svn commit: r1841597 - in /manifoldcf/branches/release-2.11-branch: ./ connectors/solr/connector/src/main/java/org/apache/manifoldcf/agents/output/solr/ModifiedHttpSolrClient.java
Date Fri, 21 Sep 2018 14:46:38 GMT
Author: kwright
Date: Fri Sep 21 14:46:38 2018
New Revision: 1841597

URL: http://svn.apache.org/viewvc?rev=1841597&view=rev
Log:
Pull up final fix for CONNECTORS-1533.

Modified:
    manifoldcf/branches/release-2.11-branch/   (props changed)
    manifoldcf/branches/release-2.11-branch/connectors/solr/connector/src/main/java/org/apache/manifoldcf/agents/output/solr/ModifiedHttpSolrClient.java

Propchange: manifoldcf/branches/release-2.11-branch/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Fri Sep 21 14:46:38 2018
@@ -152,4 +152,4 @@
 /manifoldcf/branches/CONNECTORS-981:1605049-1605773
 /manifoldcf/branches/CONNECTORS-989:1611600-1612101
 /manifoldcf/branches/CONNECTORS-990:1610284-1610707
-/manifoldcf/trunk:1841397,1841587
+/manifoldcf/trunk:1841397,1841587,1841596

Modified: manifoldcf/branches/release-2.11-branch/connectors/solr/connector/src/main/java/org/apache/manifoldcf/agents/output/solr/ModifiedHttpSolrClient.java
URL: http://svn.apache.org/viewvc/manifoldcf/branches/release-2.11-branch/connectors/solr/connector/src/main/java/org/apache/manifoldcf/agents/output/solr/ModifiedHttpSolrClient.java?rev=1841597&r1=1841596&r2=1841597&view=diff
==============================================================================
--- manifoldcf/branches/release-2.11-branch/connectors/solr/connector/src/main/java/org/apache/manifoldcf/agents/output/solr/ModifiedHttpSolrClient.java
(original)
+++ manifoldcf/branches/release-2.11-branch/connectors/solr/connector/src/main/java/org/apache/manifoldcf/agents/output/solr/ModifiedHttpSolrClient.java
Fri Sep 21 14:46:38 2018
@@ -145,6 +145,14 @@ public class ModifiedHttpSolrClient exte
     if (SolrRequest.METHOD.POST == request.getMethod() || SolrRequest.METHOD.PUT == request.getMethod())
{
 
       String url = basePath + path;
+      
+      // Hack to allow short queries to go one way, and long queries to go another.
+      final String wQueryString = toQueryString(wparams, false);
+      final boolean mustUseMultipart = url.length() + wQueryString.length() > 4000;
+      if (mustUseMultipart) {
+        streams = requestWriter.getContentStreams(request);
+      }
+      
       boolean hasNullStreamName = false;
       if (streams != null) {
         for (ContentStream cs : streams) {
@@ -158,8 +166,8 @@ public class ModifiedHttpSolrClient exte
           || (streams != null && streams.size() > 1)) && !hasNullStreamName;
 
       LinkedList<NameValuePair> postOrPutParams = new LinkedList<>();
-      if(contentWriter != null) {
-        String fullQueryUrl = url + toQueryString(wparams, false);
+      if(contentWriter != null && !mustUseMultipart) {
+        String fullQueryUrl = url + wQueryString;
         HttpEntityEnclosingRequestBase postOrPut = SolrRequest.METHOD.POST == request.getMethod()
?
             new HttpPost(fullQueryUrl) : new HttpPut(fullQueryUrl);
         postOrPut.addHeader("Content-Type",



Mime
View raw message