我不确定您使用的是哪个版本。我正在使用0.1.2,而我的工厂只有一个 setHttpClientConfig 方法。因此,我改用了
HttpClientConfig ,它扩展了 ClientConfig 。撇开这一点,构建器有两种您需要的方法:
- DiscoveryEnabled
- 发现频率
这些设置节点节点发现以及轮询的频率。
HttpClientConfig httpClientConfig = new HttpClientConfig.Builder("http://localhost:9200") .discoveryEnabled(true) .discoveryFrequency(10l, TimeUnit.SECONDS) .multiThreaded(true) .build();JestClientFactory factory = new JestClientFactory();factory.setHttpClientConfig(httpClientConfig);


