7.16.2 client esClient.shutdown(); not working
Nobody has claimed this yet.
Assessment
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Newbie friendliness
- 35/100
Research direction
Start with the connecting documentation linked in the issue and the client-lifecycle entry points shown in the snippet, especially ElasticsearchClient, ElasticsearchTransport, RestClientTransport, and esClient.shutdown(). Reproduce the compile failure with Elasticsearch 7.16.2, Elasticsearch 7.14.2, and Java 8, then compare the documented API with the actual client surface; done means the shutdown behavior and supported usage are clearly established.
Written by the indexing model from the issue text.
Description
- using docs: https://www.elastic.co/guide/en/elasticsearch/client/java-api-client/current/connecting.html I get compile error
- ES server 7.14.2
- java 8:
import co.elastic.clients.elasticsearch.ElasticsearchClient;
import co.elastic.clients.elasticsearch.core.search.Hit;
import co.elastic.clients.json.jackson.JacksonJsonpMapper;
import co.elastic.clients.transport.ElasticsearchTransport;
import co.elastic.clients.transport.rest_client.RestClientTransport;
import java.io.IOException;
import org.apache.http.HttpHost;
import org.elasticsearch.action.search.SearchResponse;
import org.elasticsearch.client.RestClient;
.....
RestClient restClient = RestClient.builder(new HttpHost("localhost", 9200)).build();
// Create the transport with a Jackson mapper
ElasticsearchTransport transport = new RestClientTransport(restClient, new JacksonJsonpMapper());
ElasticsearchClient esClient = new ElasticsearchClient(transport);
SearchResponse<Account> search = esClient.search(s
-> s.index("account*")
.query(q -> q.term(t -> t.field("username").value(v -> v.stringValue("tmajer3")))),
Account.class);
for (Hit<Account> hit : search.hits().hits()) {
System.out.println(hit.source());
}
esClient.shutdown();
- error:
never complite
- Dominant language
- Java
- Stars
- 524
- Forks
- 300
- Avg merge
- 1d 11h
- Merged PRs (30d)
- 16
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from elastic/elasticsearch-java
-
Difficulty 3/5 1-2 days Newbie friendliness 72/100
elastic/elasticsearch-java#1339 · 3 comments · 1 assignee ·
-
Difficulty 5/5 Over a week Newbie friendliness 45/100
elastic/elasticsearch-java#1212 · 8 comments ·
-
Difficulty 4/5 3-5 days Newbie friendliness 48/100
elastic/elasticsearch-java#1165 · 5 comments ·
-
Difficulty 3/5 1-2 days Newbie friendliness 45/100
elastic/elasticsearch-java#1083 · 2 comments ·
-
Area: Generator Category: Enhancement
Difficulty 3/5 1-2 days Newbie friendliness 48/100
elastic/elasticsearch-java#1034 · 2 comments ·
All issues in elastic/elasticsearch-java
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
infinispan/infinispan#18150 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
-
untriaged
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
opensearch-project/k-NN#3597 ·
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 82/100