Skip to content

Commit

Permalink
Resolved merge conflicts (#3778) (#3780)
Browse files Browse the repository at this point in the history
(cherry picked from commit ff512c4)

Signed-off-by: Fanit Kolchina <[email protected]>
Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Co-authored-by: Vacha Shah <[email protected]>
  • Loading branch information
3 people authored Apr 14, 2023
1 parent 6baaad3 commit 3fca969
Showing 1 changed file with 28 additions and 4 deletions.
32 changes: 28 additions & 4 deletions _clients/java.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,31 @@ This getting started guide illustrates how to connect to OpenSearch, index docum

## Installing the client

To start using the OpenSearch Java client, ensure that you have the following dependencies in your project's `pom.xml` file:
To start using the OpenSearch Java client, you need to provide a transport. The default `ApacheHttpClient5TransportBuilder` transport comes with the Java client. To use the OpenSearch Java client with the default transport, add it to your `pom.xml` file as a dependency:

```xml
<dependency>
<groupId>org.opensearch.client</groupId>
<artifactId>opensearch-java</artifactId>
<version>2.4.0</version>
</dependency>
```
{% include copy.html %}

If you're using Gradle, add the following dependencies to your project:

```
dependencies {
implementation 'org.opensearch.client:opensearch-java:2.4.0'
}
```
{% include copy.html %}

You can now start your OpenSearch cluster.

## Installing the client using RestClient Transport

Alternatively, you can create a Java client by using the `RestClient`-based transport. In this case, make sure that you have the following dependencies in your project's `pom.xml` file:

```xml
<dependency>
Expand All @@ -23,7 +47,7 @@ To start using the OpenSearch Java client, ensure that you have the following de
<dependency>
<groupId>org.opensearch.client</groupId>
<artifactId>opensearch-java</artifactId>
<version>2.2.0</version>
<version>2.4.0</version>
</dependency>
```
{% include copy.html %}
Expand All @@ -32,8 +56,8 @@ If you're using Gradle, add the following dependencies to your project.

```
dependencies {
implementation 'org.opensearch.client:opensearch-rest-client: {{site.opensearch_version}}'
implementation 'org.opensearch.client:opensearch-java:2.0.0'
implementation 'org.opensearch.client:opensearch-rest-client: {{site.opensearch_version}}'
implementation 'org.opensearch.client:opensearch-java:2.4.0'
}
```
{% include copy.html %}
Expand Down

0 comments on commit 3fca969

Please sign in to comment.