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
This commit is contained in:
Yonik Seeley 2013-09-25 17:52:54 +00:00
parent b1524738f3
commit 7df5169ef4
1 changed files with 6 additions and 1 deletions

View File

@ -51,7 +51,12 @@ public abstract class DocRouter {
protected String getRouteField(DocCollection coll){ protected String getRouteField(DocCollection coll){
if(coll == null) return null; 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; if(m == null) return null;
return (String) m.get("field"); return (String) m.get("field");