Некоторое время я получаю ошибку ниже и не могу получить результаты поиска.
2020-05-26 16:03:30.207 ERROR [default task-284][SearchMVCAction:148]
exception in getting response java.io.IOException: Unrecognized SSL
message, plaintext connection?
at org.elasticsearch.client.RestClient$SyncResponseListener.get(RestClient.java:954)
at org.elasticsearch.client.RestClient.performRequest(RestClient.java:229)
мой код такой, как показано ниже.
try{
RestClientBuilder builder = SearchResultsUtil.getRestClientBuilder();
RestHighLevelClient esClient = new RestHighLevelClient(builder);
SearchSourceBuilder sourceBuilder = new SearchSourceBuilder();
sourceBuilder.timeout(new TimeValue(600, TimeUnit.SECONDS)); // Request timeout
sourceBuilder.from(pagenumber);
sourceBuilder.sort(new ScoreSortBuilder().order(SortOrder.DESC)); //Result set ordering
BoolQueryBuilder query = new BoolQueryBuilder();
query.must(QueryBuilders.queryStringQuery("*"+searchWildKeyword+"*").field("content").field("title",10.0f).field("description").lenient(true).escape(true).analyzeWildcard(true).fuzziness(Fuzziness.ZERO).defaultOperator(Operator.OR).boost(1.0f));
sourceBuilder.query(query);
SearchRequest searchRequest = new SearchRequest(esIndice);
searchRequest.source(sourceBuilder);
SearchResponse searchResponse = esClient.search(searchRequest, RequestOptions.DEFAULT);
SearchHits hits = searchResponse.getHits();
System.out.println("results:"+hits);
}catch (Exception e) {
_log.error("Exception Getting Response",e);
}finally {
_log.info("inside finally block");
esClient.close();
}
также я пробовал грипп sh (), но не повезло.
finally {
_log.info("inside finally block");
esClient.close();
esClient.indices().flush(new FlushRequest(esIndice), RequestOptions.DEFAULT);
}
любезно помогите, в чем может быть причина, и я использую ES 9200 port
и https protocol
.