From 7df5169ef4e2ff2455d07359332f5503667c5a4c Mon Sep 17 00:00:00 2001 From: Yonik Seeley Date: Wed, 25 Sep 2013 17:52:54 +0000 Subject: [PATCH] SOLR-4221: make new solrj client/router able to read old clusterstate git-svn-id: https://svn.apache.org/repos/asf/lucene/dev/trunk@1526244 13f79535-47bb-0310-9956-ffa450edef68 --- .../src/java/org/apache/solr/common/cloud/DocRouter.java | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/solr/solrj/src/java/org/apache/solr/common/cloud/DocRouter.java b/solr/solrj/src/java/org/apache/solr/common/cloud/DocRouter.java index e7212eff813..fd44859ab8e 100644 --- a/solr/solrj/src/java/org/apache/solr/common/cloud/DocRouter.java +++ b/solr/solrj/src/java/org/apache/solr/common/cloud/DocRouter.java @@ -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");