/** This method is consulted to determine what slices should be queried for a request when * an explicit shards parameter was not used. * This method accepts a multi-valued shardKeys parameter (normally comma separated from the shard.keys request parameter) * and aggregates the slices returned by getSearchSlicesSingle for each shardKey. **/ public Collection<Slice> getSearchSlices(String shardKeys, SolrParams params, DocCollection collection) { if (shardKeys == null || shardKeys.indexOf(',') < 0) { return getSearchSlicesSingle(shardKeys, params, collection); } List<String> shardKeyList = StrUtils.splitSmart(shardKeys, ",", true); HashSet<Slice> allSlices = new HashSet<>(); for (String shardKey : shardKeyList) { allSlices.addAll( getSearchSlicesSingle(shardKey, params, collection) ); } return allSlices; }
/** This method is consulted to determine what slices should be queried for a request when * an explicit shards parameter was not used. * This method accepts a multi-valued shardKeys parameter (normally comma separated from the shard.keys request parameter) * and aggregates the slices returned by getSearchSlicesSingle for each shardKey. **/ public Collection<Slice> getSearchSlices(String shardKeys, SolrParams params, DocCollection collection) { if (shardKeys == null || shardKeys.indexOf(',') < 0) { return getSearchSlicesSingle(shardKeys, params, collection); } List<String> shardKeyList = StrUtils.splitSmart(shardKeys, ",", true); HashSet<Slice> allSlices = new HashSet<>(); for (String shardKey : shardKeyList) { allSlices.addAll( getSearchSlicesSingle(shardKey, params, collection) ); } return allSlices; }