如果我不设置大小,我可以获得 10 次点击:
SearchResponse sr = client.prepareSearch("xxx").setTypes("xxx")
.setQuery(rangeQueryBuilder)
.setQuery(queryBuilder)
但是当我设置大小超过 12 时:
SearchResponse sr = client.prepareSearch("xxx").setTypes("xxx")
.setSize(13)
.setQuery(rangeQueryBuilder)
.setQuery(queryBuilder)
我遇到了这个问题:NoNodeAvailableException[没有配置的节点可用:[{gw_172.28.236.85:40001}{oHcfPhqFQDSW4opwUuzCpA}{P1GbtDqrRda4nlbRRBmW1Q}{172.28.236.85}{172.28.236.85:40101}{xpack.installed=true} ,我的java连接代码:
public static TransportClient client() throws UnknownHostException {
if (client != null) {
return client;
}
synchronized (esConnection_old.class) {
if (client == null) {
Settings settings = Settings.builder().put("cluster.name", ClusterName)
.put("client.transport.sniff", false)
.put(SecurityKey, basicAuthHeaderValue(SecurityUser, SecurityPassword))
.build();
client = new PreBuiltTransportClient(settings);
String[] oneInstance = GatewayIpPorts.split(",");
for (String item : oneInstance) {
String[] ipPort = item.split(":");
client.addTransportAddresses(new TransportAddress(InetAddress.getByName(ipPort[0]), Integer.parseInt(ipPort[1])));
}
return client;
}
return client;
}
}