# Opensearch 2.7.x client documentation

**URL:** <https://forum.opensearch.org/t/opensearch-2-7-x-client-documentation/14424>\
**Category:** OpenSearch Client Libraries\
**Tags:** opensearch-java\
**Created:** [May 22, 2023, 4:14pm UTC](https://forum.opensearch.org/t/opensearch-2-7-x-client-documentation/14424 "2023-05-22T16:14:44Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![firated](https://avatars.discourse-cdn.com/v4/letter/f/a9a28c/32.png) [@firated](https://forum.opensearch.org/u/firated)\
**Post date:** [May 22, 2023, 4:14pm UTC](https://forum.opensearch.org/t/opensearch-2-7-x-client-documentation/14424/1 "2023-05-22T16:14:45Z")

</div>

**Versions** (relevant - OpenSearch/Dashboard/Server OS/Browser):  
OpenSearch 2.7.x

**Describe the issue** :

Hi, while I have been checking the documentation of opensearch clients for 2.7.x on [Java client - OpenSearch documentation](https://opensearch.org/docs/latest/clients/java/) I have seen that some of the examples (eg [Java client - OpenSearch documentation](https://opensearch.org/docs/latest/clients/java/#initializing-the-client-with-ssl-and-tls-enabled-using-restclient-transport)) are using  
org.apache.hc.client5 and org.apache.hc.core5 packages, but sample program on [Java client - OpenSearch documentation](https://opensearch.org/docs/latest/clients/java/#sample-program) is done with org.apache.http. packages.  
I think this is leading a developer to a confusion of which libraries to use, because when I try to go with first example , my code can not build, but the documentation does not state that I may need a third party dependencies to run the example which uses the hc packages.  
Also, It would be good if we could see a complete example on the create client part of the developer guide.  
[opensearch-java/USER\_GUIDE.md at main · opensearch-project/opensearch-java · GitHub](https://github.com/opensearch-project/opensearch-java/blob/main/USER_GUIDE.md#create-a-client)

**Configuration** :  
implementation ‘org.opensearch.client:opensearch-rest-client:2.7.0’  
implementation ‘org.opensearch.client:opensearch-java:2.4.0’

PS: There is an extra space on documented gradle script between rest-client and 2.7.0 on the documentation

```auto
dependencies {
  **implementation 'org.opensearch.client:opensearch-rest-client: 2.7.0'**
  implementation 'org.opensearch.client:opensearch-java:2.4.0'
}

```

---

<div class="post-metadata">

**Author:** ![wbeckler](https://avatars.discourse-cdn.com/v4/letter/w/9d8465/32.png) [@wbeckler](https://forum.opensearch.org/u/wbeckler)\
**Post date:** [May 22, 2023, 8:09pm UTC](https://forum.opensearch.org/t/opensearch-2-7-x-client-documentation/14424/2 "2023-05-22T20:09:43Z")

</div>

This is a very good point. Feel free to raise this as an issue in the opensearch-java github repository.

---

<div class="post-metadata">

**Author:** ![firated](https://avatars.discourse-cdn.com/v4/letter/f/a9a28c/32.png) [@firated](https://forum.opensearch.org/u/firated)\
**Post date:** [May 23, 2023, 6:36am UTC](https://forum.opensearch.org/t/opensearch-2-7-x-client-documentation/14424/3 "2023-05-23T06:36:58Z")

</div>

just opened one

> <https://github.com/opensearch-project/opensearch-java/issues/499>
>
> \### Is your feature request related to a problem?
> While I have been checking th…e documentation of opensearch clients for 2.7.x on \[Java client - OpenSearch documentation\](https://opensearch.org/docs/latest/clients/java/) I have seen that some of the examples (eg \[Java client - OpenSearch documentation\](https://opensearch.org/docs/latest/clients/java/#initializing-the-client-with-ssl-and-tls-enabled-using-restclient-transport)) are using
> org.apache.hc.client5 and org.apache.hc.core5 packages, but sample program on \[Java client - OpenSearch documentation\](https://opensearch.org/docs/latest/clients/java/#sample-program) is done with org.apache.http. packages.
> 
> 
> \### What solution would you like?
> Documentation should state that I need a additional third party dependencies to run the example which uses the hc packages.
> Also, It would be good if we could see a complete example on the create client part of the developer guide for each versions.
> \[opensearch-java/USER\_GUIDE.md at main · opensearch-project/opensearch-java · GitHub\](https://github.com/opensearch-project/opensearch-java/blob/main/USER\_GUIDE.md#create-a-client)
> 
> \### What alternatives have you considered?
> 
> \### Do you have any additional context?
> Version : OpenSearch 2.7.x
> OS Forum Question Link : https://forum.opensearch.org/t/opensearch-2-7-x-client-documentation/14424
> implementation ‘org.opensearch.client:opensearch-rest-client:2.7.0’
> implementation ‘org.opensearch.client:opensearch-java:2.4.0’
> 
> PS: There is an extra space on documentation of gradle script (between rest-client and 2.7.0 parts)
> dependencies {
> \*\*implementation 'org.opensearch.client:opensearch-rest-client: 2.7.0'\*\*
> implementation 'org.opensearch.client:opensearch-java:2.4.0'
> }
> 
> Thanks!

Thanks

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex019/uploads/mauve_hedgehog/original/2X/3/33547ea01a5b12dcca2958411d3edd97ae2ea8c1.png) [@system](https://forum.opensearch.org/u/system)\
**Post date:** [July 22, 2023, 6:37am UTC](https://forum.opensearch.org/t/opensearch-2-7-x-client-documentation/14424/4 "2023-07-22T06:37:18Z")

</div>

Closed on July 22, 2023, 6:37am UTC

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