Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -109,12 +109,14 @@ private void withShardsParam(Builder builder, String shardsParam) {
if (sliceOrUrl.indexOf('/') < 0) {
// this is a logical shard
this.slices[i] = sliceOrUrl;
DocCollection coll = clusterState.getCollectionOrNull(builder.collection, true);
if (coll == null) {
throw new SolrException(
SolrException.ErrorCode.BAD_REQUEST,
"Could not find collection to resolve replicas: " + builder.collection);
}
replicas[i] =
findReplicas(
builder,
shardsParam,
clusterState,
clusterState.getCollection(builder.collection).getSlice(sliceOrUrl));
findReplicas(builder, shardsParam, clusterState, coll.getSlice(sliceOrUrl));
} else {
// this has urls
this.replicas[i] = StrUtils.splitSmart(sliceOrUrl, "|", true);
Expand Down Expand Up @@ -189,7 +191,11 @@ private void addSlices(
String collectionName,
String shardKeys,
boolean multiCollection) {
DocCollection coll = state.getCollection(collectionName);
DocCollection coll = state.getCollectionOrNull(collectionName, true);
if (coll == null) {
throw new SolrException(
SolrException.ErrorCode.BAD_REQUEST, "Could not find collection to add slices: " + collectionName);
}
Collection<Slice> slices = coll.getRouter().getSearchSlices(shardKeys, params, coll);
ClientUtils.addSlices(target, collectionName, slices, multiCollection);
}
Expand Down
Loading