Settings settings = Settings.settingsBuilder()
.put("cluster.name", "logging_elasticsearch")
.build();
TransportClient client = TransportClient.builder()
.settings(settings)
.build()
.addTransportAddress(new InetSocketTransportAddress(InetAddress.getByAddress(new byte[]{10,100,30,62}), 9300));
SearchResponse response = client.prepareSearch("logstash-2016.09.08")
.setTypes("type1", "type2")
.setSearchType(SearchType.DFS_QUERY_THEN_FETCH)
.setQuery(QueryBuilders.termQuery("multi", "test")) // Query
.setPostFilter(QueryBuilders.rangeQuery("age").from(12).to(18)) // Filter
.setFrom(0).setSize(60).setExplain(true)
.execute()
.actionGet();
elasticsearch.yml 執行我的搜索查詢時,我得到一個NoNodeAvailableException
。配置的節點Elasticsearch NoNodeAvailableException無可用
我試過這個解決方案: https://stackoverflow.com/a/33875764/2616923 但它沒有工作。