SOLR-5679: SOLR-5679: Shard splitting fails with ClassCastException on collections upgraded from 4.5 and earlier versions

git-svn-id: https://svn.apache.org/repos/asf/lucene/dev/trunk@1562872 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Shalin Shekhar Mangar 2014-01-30 16:06:50 +00:00
parent d5a8bdd767
commit 968d6f98cc
2 changed files with 7 additions and 4 deletions

View File

@ -237,7 +237,9 @@ Bug Fixes
* SOLR-5230: Call DelegatingCollector.finish() during grouping.
(Joel Bernstein, ehatcher)
* SOLR-5679: Shard splitting fails with ClassCastException on collections
upgraded from 4.5 and earlier versions. (Brett Hoerner, shalin)
Optimizations
----------------------

View File

@ -295,9 +295,10 @@ public class CoreAdminHandler extends RequestHandlerBase {
DocRouter.Range currentRange = slice.getRange();
ranges = currentRange != null ? router.partitionRange(partitions, currentRange) : null;
}
Map m = (Map) collection.get(DOC_ROUTER);
if (m != null) {
routeFieldName = (String) m.get("field");
Object routerObj = collection.get(DOC_ROUTER); // for back-compat with Solr 4.4
if (routerObj != null && routerObj instanceof Map) {
Map routerProps = (Map) routerObj;
routeFieldName = (String) routerProps.get("field");
}
}