Only add the local TLD.
@@ -152,19 +152,21 @@ public class ClusterSearcher extends Searcher {
gotExpectedBackend = true;
} else {
for (int dispatcherIndex = 0; dispatcherIndex < searchClusterConfig.dispatcher().size(); dispatcherIndex++) {
+ try {
+ if (! isRemote(searchClusterConfig.dispatcher(dispatcherIndex).host())) {
Backend b = createBackend(searchClusterConfig.dispatcher(dispatcherIndex));
FastSearcher searcher = searchDispatch(searchClusterIndex, fs4ResourcePool,
searchClusterConfig, cacheParams, emulationConfig, docSumParams,
documentDbConfig, b, dispatcher, dispatcherIndex);
- try {
- searcher.setLocalDispatching( ! isRemote(searchClusterConfig.dispatcher(dispatcherIndex).host()));
- } catch (UnknownHostException e) {
- throw new RuntimeException(e);
- }
+ searcher.setLocalDispatching(true);
backends.add(b);
addBackendSearcher(searcher);
gotExpectedBackend |= searcher.isLocalDispatching();
}
+ } catch (UnknownHostException e) {
+ throw new RuntimeException(e);
+ }
+ }
}
if ( ! gotExpectedBackend) {
log.log(Level.SEVERE, "ClusterSearcher should have a local top level dispatch."
