# How to implement Search using Java API Client 8.1

**URL:** <https://discuss.elastic.co/t/how-to-implement-search-using-java-api-client-8-1/301153>\
**Category:** Elasticsearch\
**Tags:** language-clients\
**Created:** [March 31, 2022, 2:28am UTC](https://discuss.elastic.co/t/how-to-implement-search-using-java-api-client-8-1/301153 "2022-03-31T02:28:52Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![ksuren](https://avatars.discourse-cdn.com/v4/letter/k/74df32/32.png) [@ksuren](https://discuss.elastic.co/u/ksuren)\
**Post date:** [March 31, 2022, 2:28am UTC](https://discuss.elastic.co/t/how-to-implement-search-using-java-api-client-8-1/301153/1 "2022-03-31T02:28:52Z")

</div>

The docs here [Elasticsearch Java API Client [8.1] | Elastic](https://www.elastic.co/guide/en/elasticsearch/client/java-api-client/8.1/index.html) do not have clear examples of using the Java API Client. Although I can view the docs for all the available classes [Overview (java-client 8.1.1 API)](https://artifacts.elastic.co/javadoc/co/elastic/clients/elasticsearch-java/8.1.1/index.html) but not sure which one to use.

There are some snippets here [Creating API objects from JSON data | Elasticsearch Java API Client [8.1] | Elastic](https://www.elastic.co/guide/en/elasticsearch/client/java-api-client/8.1/loading-json.html) but not complete.

On the internet (and stack overflow) there are several implementations detailed (SearchRequest Builder, Search Request, Search Response, Query Builder etc.). I would like to implement a basic search and extend that.

Would appreciate if a doc or an official example details the correct way.

---

<div class="post-metadata">

**Author:** ![spinscale](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/spinscale/32/25011_2.png) [@spinscale](https://discuss.elastic.co/u/spinscale)\
**Post date:** [March 31, 2022, 11:54am UTC](https://discuss.elastic.co/t/how-to-implement-search-using-java-api-client-8-1/301153/2 "2022-03-31T11:54:46Z")

</div>

Documentation is currently in the works, see the github issues at [Issues · elastic/elasticsearch-java · GitHub](https://github.com/elastic/elasticsearch-java/issues?q=is%3Aopen+is%3Aissue+label%3A%3Edocumentation)

In the meantime, if you have any issues, we're happy to help over here. I created a small sample project using the Elasticsearch client a while back, maybe that helps you as well [GitHub - spinscale/elasticsearch-rest-client-samples: Elasticsearch REST client samples using Testcontainers](https://github.com/spinscale/elasticsearch-rest-client-samples)

---

<div class="post-metadata">

**Author:** ![ksuren](https://avatars.discourse-cdn.com/v4/letter/k/74df32/32.png) [@ksuren](https://discuss.elastic.co/u/ksuren)\
**Post date:** [March 31, 2022, 2:24pm UTC](https://discuss.elastic.co/t/how-to-implement-search-using-java-api-client-8-1/301153/3 "2022-03-31T14:24:23Z")

</div>

Thanks @spinscale

I'm working on similar using Helidon framework, and can help with the documentation.

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [April 28, 2022, 2:24pm UTC](https://discuss.elastic.co/t/how-to-implement-search-using-java-api-client-8-1/301153/4 "2022-04-28T14:24:50Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
