lucene-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From yo...@apache.org
Subject svn commit: r1526244 - /lucene/dev/trunk/solr/solrj/src/java/org/apache/solr/common/cloud/DocRouter.java
Date Wed, 25 Sep 2013 17:52:55 GMT
Author: yonik
Date: Wed Sep 25 17:52:54 2013
New Revision: 1526244

URL: http://svn.apache.org/r1526244
Log:
SOLR-4221: make new solrj client/router able to read old clusterstate

Modified:
    lucene/dev/trunk/solr/solrj/src/java/org/apache/solr/common/cloud/DocRouter.java

Modified: lucene/dev/trunk/solr/solrj/src/java/org/apache/solr/common/cloud/DocRouter.java
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/solr/solrj/src/java/org/apache/solr/common/cloud/DocRouter.java?rev=1526244&r1=1526243&r2=1526244&view=diff
==============================================================================
--- lucene/dev/trunk/solr/solrj/src/java/org/apache/solr/common/cloud/DocRouter.java (original)
+++ lucene/dev/trunk/solr/solrj/src/java/org/apache/solr/common/cloud/DocRouter.java Wed Sep
25 17:52:54 2013
@@ -51,7 +51,12 @@ public abstract class DocRouter {
 
   protected String getRouteField(DocCollection coll){
     if(coll == null) return null;
-    Map m = (Map) coll.get(DOC_ROUTER);
+    Object o = coll.get(DOC_ROUTER);
+    if (o instanceof String) {
+      return null;
+      //old format. cannot have a routefield. Ignore it
+    }
+    Map m = (Map) o;
     if(m == null) return null;
     return (String) m.get("field");
 



Mime
View raw message