spring 4.3.22;
spring-data-elasticsearch3.1.3.RELEASE
elasticsearch-rest-high-level-client、elasticsearch-rest-client、elasticsearch均为6.2.2
调用代码:
SearchSourceBuilder sourceBuilder = new SearchSourceBuilder();
SearchRequest rq = new SearchRequest(); rq.indices("local_myindex"); sourceBuilder.query(QueryBuilders.matchAllQuery());
RestHighLevelClient clients = new RestHighLevelClient( RestClient.builder(new HttpHost("localhost", 9200, "http")));
try { SearchResponse rp = clients.search(rq,new BasicHeader("contentType","application/json"));
报错:
java.lang.IllegalStateException: Request cannot be executed; I/O reactor status: STOPPED
at org.apache.http.util.Asserts.check(Asserts.java:40)
at org.apache.http.impl.nio.client.InternalHttpAsyncClient.execute(InternalHttpAsyncClient.java:112)
at org.elasticsearch.client.RestClient.performRequestAsync(RestClient.java:346)
at org.elasticsearch.client.RestClient.performRequestAsync(RestClient.java:328)
at org.elasticsearch.client.RestClient.performRequest(RestClient.java:221)
at org.elasticsearch.client.RestClient.performRequest(RestClient.java:194)
at org.elasticsearch.client.RestHighLevelClient.performRequest(RestHighLevelClient.java:488)
at org.elasticsearch.client.RestHighLevelClient.performRequestAndParseEntity(RestHighLevelClient.java:474)
at org.elasticsearch.client.RestHighLevelClient.search(RestHighLevelClient.java:391)
spring-data-elasticsearch3.1.3.RELEASE
elasticsearch-rest-high-level-client、elasticsearch-rest-client、elasticsearch均为6.2.2
调用代码:
SearchSourceBuilder sourceBuilder = new SearchSourceBuilder();
SearchRequest rq = new SearchRequest(); rq.indices("local_myindex"); sourceBuilder.query(QueryBuilders.matchAllQuery());
RestHighLevelClient clients = new RestHighLevelClient( RestClient.builder(new HttpHost("localhost", 9200, "http")));
try { SearchResponse rp = clients.search(rq,new BasicHeader("contentType","application/json"));
报错:
java.lang.IllegalStateException: Request cannot be executed; I/O reactor status: STOPPED
at org.apache.http.util.Asserts.check(Asserts.java:40)
at org.apache.http.impl.nio.client.InternalHttpAsyncClient.execute(InternalHttpAsyncClient.java:112)
at org.elasticsearch.client.RestClient.performRequestAsync(RestClient.java:346)
at org.elasticsearch.client.RestClient.performRequestAsync(RestClient.java:328)
at org.elasticsearch.client.RestClient.performRequest(RestClient.java:221)
at org.elasticsearch.client.RestClient.performRequest(RestClient.java:194)
at org.elasticsearch.client.RestHighLevelClient.performRequest(RestHighLevelClient.java:488)
at org.elasticsearch.client.RestHighLevelClient.performRequestAndParseEntity(RestHighLevelClient.java:474)
at org.elasticsearch.client.RestHighLevelClient.search(RestHighLevelClient.java:391)
3 个回复
tongchuan1992 - 学无止境、学以致用
赞同来自:
superman
赞同来自:
codersun
赞同来自: