manifoldcf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kwri...@apache.org
Subject svn commit: r1670715 - in /manifoldcf/trunk: CHANGES.txt connectors/solr/connector/src/main/java/org/apache/manifoldcf/agents/output/solr/SolrConnector.java
Date Wed, 01 Apr 2015 16:21:56 GMT
Author: kwright
Date: Wed Apr  1 16:21:56 2015
New Revision: 1670715

URL: http://svn.apache.org/r1670715
Log:
Fix for CONNECTORS-1179.

Modified:
    manifoldcf/trunk/CHANGES.txt
    manifoldcf/trunk/connectors/solr/connector/src/main/java/org/apache/manifoldcf/agents/output/solr/SolrConnector.java

Modified: manifoldcf/trunk/CHANGES.txt
URL: http://svn.apache.org/viewvc/manifoldcf/trunk/CHANGES.txt?rev=1670715&r1=1670714&r2=1670715&view=diff
==============================================================================
--- manifoldcf/trunk/CHANGES.txt (original)
+++ manifoldcf/trunk/CHANGES.txt Wed Apr  1 16:21:56 2015
@@ -3,6 +3,10 @@ $Id$
 
 ======================= 2.1-dev =====================
 
+CONNECTORS-1179: Include the collection name as part of the Solr
+version string.
+(Kamil Żyta, Karl Wright)
+
 CONNECTORS-1178: Script example broken.
 (Karl Wright)
 

Modified: manifoldcf/trunk/connectors/solr/connector/src/main/java/org/apache/manifoldcf/agents/output/solr/SolrConnector.java
URL: http://svn.apache.org/viewvc/manifoldcf/trunk/connectors/solr/connector/src/main/java/org/apache/manifoldcf/agents/output/solr/SolrConnector.java?rev=1670715&r1=1670714&r2=1670715&view=diff
==============================================================================
--- manifoldcf/trunk/connectors/solr/connector/src/main/java/org/apache/manifoldcf/agents/output/solr/SolrConnector.java
(original)
+++ manifoldcf/trunk/connectors/solr/connector/src/main/java/org/apache/manifoldcf/agents/output/solr/SolrConnector.java
Wed Apr  1 16:21:56 2015
@@ -96,6 +96,9 @@ public class SolrConnector extends org.a
   
   /** Whether or not to commit */
   protected boolean doCommits = false;
+
+  /** Collection name (non-empty only if SolrCloud) */
+  protected String collectionName = null;
   
   /** Idle connection expiration interval */
   protected final static long EXPIRATION_INTERVAL = 300000L;
@@ -185,6 +188,7 @@ public class SolrConnector extends org.a
     mimeTypeAttributeName = null;
     contentAttributeName = null;
     useExtractUpdateHandler = true;
+    collectionName = null;
     super.disconnect();
   }
 
@@ -340,6 +344,8 @@ public class SolrConnector extends org.a
         if (connectTimeoutString == null)
           connectTimeoutString = "60";
         
+        collectionName = null;
+        
         try
         {
           int socketTimeout = Integer.parseInt(socketTimeoutString) * 1000;
@@ -385,6 +391,7 @@ public class SolrConnector extends org.a
         String collection = params.getParameter(SolrConfig.PARAM_COLLECTION);
         if (collection == null)
           collection = "collection1";
+        collectionName = collection;
 
         // Pick up timeouts
         String zkClientTimeoutString = params.getParameter(SolrConfig.PARAM_ZOOKEEPER_CLIENT_TIMEOUT);
@@ -2326,6 +2333,14 @@ public class SolrConnector extends org.a
       else
         sb.append('-');
 
+      if (collectionName != null)
+      {
+        sb.append('+');
+        pack(sb,collectionName,'+');
+      }
+      else
+        sb.append('-');
+      
       return sb.toString();
     }
     



Mime
View raw message