# Is REST Client for Elasticsearch the only way to go in the future?

**URL:** https://discuss.elastic.co/t/is-rest-client-for-elasticsearch-the-only-way-to-go-in-the-future/93233
**Category:** Elasticsearch
**Created:** [July 14, 2017, 6:41pm UTC](https://discuss.elastic.co/t/is-rest-client-for-elasticsearch-the-only-way-to-go-in-the-future/93233 "2017-07-14T18:41:37Z")
**Posts on this page:** 16
**Page:** 1

<div class="post-metadata">

### Author: ![Ong](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/ong/32/40766_2.png) [@Ong](https://discuss.elastic.co/u/Ong)
#### Post date: [July 14, 2017, 6:41pm UTC](https://discuss.elastic.co/t/is-rest-client-for-elasticsearch-the-only-way-to-go-in-the-future/93233/1 "2017-07-14T18:41:37Z")

</div>

I recently attended an Elasticsearch Developers course and understand that the Java API will be dropped in the near future and the Java REST client is the way to go.

A Elasticsearch blog post seemed to confirm this too:  
[State of Official Elasticsearch Java Clients](https://www.elastic.co/blog/state-of-the-official-elasticsearch-java-clients)

What about other clients like JavaScript API or the .NET API? Are they also at risk of being dropped?

Will the Java REST client be the only way to develop for ES?

---

<div class="post-metadata">

### Author: ![cbuescher](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/cbuescher/32/60402_2.png) [@cbuescher](https://discuss.elastic.co/u/cbuescher)
#### Post date: [July 14, 2017, 6:57pm UTC](https://discuss.elastic.co/t/is-rest-client-for-elasticsearch-the-only-way-to-go-in-the-future/93233/2 "2017-07-14T18:57:45Z")

</div>

No, this has nothing to do with other clients like JavaScript API or the .NET API. Also, the new high level rest client will only be the java rest client that will be developed as part of the Elasticsearch project, but there are already other java rest clients out there (like the popular [Jest](https://github.com/searchbox-io/Jest/tree/master/jest) client) that you can use. However, we hope that over time users will use the new Elasticsearch Java rest and that by further development and contributions by the community we can make it the best maintained client for Java users.

---

<div class="post-metadata">

### Author: ![Dan\_Markhasin](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dan_markhasin/32/14187_2.png) [@Dan\_Markhasin](https://discuss.elastic.co/u/Dan_Markhasin)
#### Post date: [July 15, 2017, 9:13am UTC](https://discuss.elastic.co/t/is-rest-client-for-elasticsearch-the-only-way-to-go-in-the-future/93233/3 "2017-07-15T09:13:17Z")

</div>

@cbuescher, the blog post linked by OP states:

"As soon as the REST client is feature complete and is mature enough to replace the Java API entirely, we will deprecate and finally remove the transport client and the Java API."

Is this still true? Are you still planning to remove the transport client in the long term?

---

<div class="post-metadata">

### Author: ![cbuescher](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/cbuescher/32/60402_2.png) [@cbuescher](https://discuss.elastic.co/u/cbuescher)
#### Post date: [July 15, 2017, 10:18am UTC](https://discuss.elastic.co/t/is-rest-client-for-elasticsearch-the-only-way-to-go-in-the-future/93233/4 "2017-07-15T10:18:17Z")

</div>

> [@Dan\_Markhasin](#):
>
> we will deprecate and finally remove the transport client

Yes, that is still the plan.

---

<div class="post-metadata">

### Author: ![Dan\_Markhasin](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dan_markhasin/32/14187_2.png) [@Dan\_Markhasin](https://discuss.elastic.co/u/Dan_Markhasin)
#### Post date: [July 16, 2017, 8:51am UTC](https://discuss.elastic.co/t/is-rest-client-for-elasticsearch-the-only-way-to-go-in-the-future/93233/5 "2017-07-16T08:51:12Z")

</div>

Where can I find the high level rest client? The documentation points to the following artifact:

 org.elasticsearch.client elasticsearch-rest-high-level-client 6.0.0-alpha2

But I can't find this artifact in Maven..

---

<div class="post-metadata">

### Author: ![cbuescher](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/cbuescher/32/60402_2.png) [@cbuescher](https://discuss.elastic.co/u/cbuescher)
#### Post date: [July 16, 2017, 10:34am UTC](https://discuss.elastic.co/t/is-rest-client-for-elasticsearch-the-only-way-to-go-in-the-future/93233/6 "2017-07-16T10:34:34Z")

</div>

Hi,

the high level client will only be released with 6.0.0-beta1. The reason its already in the alpha2 docs is because we build them directly out of the master branch. There is a short note at the top of [https://www.elastic.co/guide/en/elasticsearch/client/java-rest/master/java-rest-high.html](https://www.elastic.co/guide/en/elasticsearch/client/java-rest/master/java-rest-high.html) which is supposed as a hint for that, but I understand it can be confusing.

---

<div class="post-metadata">

### Author: ![khatkarrohit](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/khatkarrohit/32/20293_2.png) [@khatkarrohit](https://discuss.elastic.co/u/khatkarrohit)
#### Post date: [July 20, 2017, 4:05pm UTC](https://discuss.elastic.co/t/is-rest-client-for-elasticsearch-the-only-way-to-go-in-the-future/93233/7 "2017-07-20T16:05:09Z")

</div>

Is there any way get the alpha release jar or dependency.

I read on Elastic Search blog that Low level rest api is compatible with all Elastic Search client.

```
RestHighLevelClient client =
new RestHighLevelClient(lowLevelRestClient);

```

High level rest uses low level rest client, does it mean high level rest client is compatible with all version ?

Please provide us the high level alpha release as I am implementing the same functionality myself.

---

<div class="post-metadata">

### Author: ![cbuescher](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/cbuescher/32/60402_2.png) [@cbuescher](https://discuss.elastic.co/u/cbuescher)
#### Post date: [August 8, 2017, 2:30pm UTC](https://discuss.elastic.co/t/is-rest-client-for-elasticsearch-the-only-way-to-go-in-the-future/93233/8 "2017-08-08T14:30:11Z")

</div>

> [@khatkarrohit](#):
>
> Please provide us the high level alpha release

I'm afraid, until either ES 5.6 or 6.0.0-beta1 you will be release you will need to build the jar yourself using the respective 5.6 or master branch of the source code.

> [@khatkarrohit](#):
>
> does it mean high level rest client is compatible with all version

No, the High-Level client currently depends on a fixed version of ES (\>5.6), mainly to use the same query, aggs builders etc... that the current transport client uses to make the transition there easy ([Compatibility | Java REST Client [6.0] | Elastic](https://www.elastic.co/guide/en/elasticsearch/client/java-rest/6.0/java-rest-high-compatibility.html))

---

<div class="post-metadata">

### Author: ![dadoonet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dadoonet/32/137187_2.png) [@dadoonet](https://discuss.elastic.co/u/dadoonet)
#### Post date: [August 8, 2017, 3:01pm UTC](https://discuss.elastic.co/t/is-rest-client-for-elasticsearch-the-only-way-to-go-in-the-future/93233/9 "2017-08-08T15:01:09Z")

</div>

That's actually possible with the SNAPSHOT versions.

See

> <https://github.com/elastic/elasticsearch/issues/23331#issuecomment-318708280>

I prepared the migration for my project here: [https://github.com/dadoonet/fscrawler/pull/417](https://github.com/dadoonet/fscrawler/pull/417)

Just waiting for the release 🙂

---

<div class="post-metadata">

### Author: ![cbuescher](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/cbuescher/32/60402_2.png) [@cbuescher](https://discuss.elastic.co/u/cbuescher)
#### Post date: [August 8, 2017, 3:16pm UTC](https://discuss.elastic.co/t/is-rest-client-for-elasticsearch-the-only-way-to-go-in-the-future/93233/10 "2017-08-08T15:16:40Z")

</div>

Thanks @dadoonet, good to know. I missed that.

---

<div class="post-metadata">

### Author: ![khatkarrohit](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/khatkarrohit/32/20293_2.png) [@khatkarrohit](https://discuss.elastic.co/u/khatkarrohit)
#### Post date: [August 9, 2017, 4:09pm UTC](https://discuss.elastic.co/t/is-rest-client-for-elasticsearch-the-only-way-to-go-in-the-future/93233/11 "2017-08-09T16:09:12Z")

</div>

Thanks @cbuescher , I use AWS Elastic-search and AWS uses older version so I will not be able to High Level Rest Client. AWS is still at 5.3 only.

---

<div class="post-metadata">

### Author: ![cbuescher](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/cbuescher/32/60402_2.png) [@cbuescher](https://discuss.elastic.co/u/cbuescher)
#### Post date: [August 9, 2017, 4:24pm UTC](https://discuss.elastic.co/t/is-rest-client-for-elasticsearch-the-only-way-to-go-in-the-future/93233/12 "2017-08-09T16:24:51Z")

</div>

T[quote="khatkarrohit, post:11, topic:93233"]  
AWS uses older version so I will not be able to High Level Rest Client. AWS is still at 5.3 only  
[/quote]

That depends, I would give it a try. After all, you would run the HL client in your application, and it talks via REST with the cluster. So if the cluster is 5.3, you are running e.g. 5.6 in your client app you _should_ be fine. Changes in the REST Api shouldn't happen in minor versions. I don't know if there are other considerations but if you can I'd try it out.

---

<div class="post-metadata">

### Author: ![khatkarrohit](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/khatkarrohit/32/20293_2.png) [@khatkarrohit](https://discuss.elastic.co/u/khatkarrohit)
#### Post date: [August 9, 2017, 5:00pm UTC](https://discuss.elastic.co/t/is-rest-client-for-elasticsearch-the-only-way-to-go-in-the-future/93233/13 "2017-08-09T17:00:30Z")

</div>

@cbuescher I will give it a try once it is released in Maven repo.

Low level rest client is compatible with all versions and High level rest client uses Low level internally. So high level rest client should be fine with older version that work with Low level rest client.

---

<div class="post-metadata">

### Author: ![khatkarrohit](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/khatkarrohit/32/20293_2.png) [@khatkarrohit](https://discuss.elastic.co/u/khatkarrohit)
#### Post date: [August 10, 2017, 1:34pm UTC](https://discuss.elastic.co/t/is-rest-client-for-elasticsearch-the-only-way-to-go-in-the-future/93233/14 "2017-08-10T13:34:19Z")

</div>

I tried beta1 but when I include High level rest client in spring boot application than it gives some Class not found exception.

> Caused by: java.lang.ClassNotFoundException: org.elasticsearch.common.xcontent.NamedXContentRegistry

If I add Elaticsearch as dependency than it gives another error:

> Caused by: java.lang.ClassNotFoundException: org.apache.lucene.util.Version

I tried building last month from snapshot version but it created a dependency hell. Still with beta version it has same issues.

My maven:

```
<dependencies>
    <dependency>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-web</artifactId>
    </dependency>

    <dependency>
        <groupId>org.projectlombok</groupId>
        <artifactId>lombok</artifactId>
        <optional>true</optional>
    </dependency>
    <dependency>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-test</artifactId>
        <scope>test</scope>
    </dependency>
    <!-- https://mvnrepository.com/artifact/javax.json/javax.json-api -->
    <dependency>
        <groupId>javax.json</groupId>
        <artifactId>javax.json-api</artifactId>
        <version>1.1</version>
    </dependency>
    <!-- https://mvnrepository.com/artifact/org.glassfish/javax.json -->
    <dependency>
        <groupId>org.glassfish</groupId>
        <artifactId>javax.json</artifactId>
        <version>1.1</version>
    </dependency>
    <dependency>
        <groupId>org.elasticsearch.client</groupId>
        <artifactId>elasticsearch-rest-high-level-client</artifactId>
        <version>6.0.0-beta1</version>
    </dependency>
    <dependency>
        <groupId>org.elasticsearch</groupId>
        <artifactId>elasticsearch</artifactId>
        <version>6.0.0-beta1</version>
    </dependency>
</dependencies>

```

Spring Bean creation:

```
    @Bean
    @Qualifier("resthighlevel")
    public RestHighLevelClient restHighLevelClient() throws Exception {
        RestClient restClient = RestClient.builder(new HttpHost(esHost, 443, "https")).build();
        RestHighLevelClient client = new RestHighLevelClient(restClient);
        return client;
    }

```

---

<div class="post-metadata">

### Author: ![dadoonet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dadoonet/32/137187_2.png) [@dadoonet](https://discuss.elastic.co/u/dadoonet)
#### Post date: [August 10, 2017, 2:55pm UTC](https://discuss.elastic.co/t/is-rest-client-for-elasticsearch-the-only-way-to-go-in-the-future/93233/15 "2017-08-10T14:55:59Z")

</div>

I think you are hitting this:

> <https://github.com/elastic/elasticsearch/pull/26113>

Add this repository:

```auto
        <repository>
            <id>elastic-lucene-snapshots</id>
            <name>Elastic Lucene Snapshots</name>
            <url>http://s3.amazonaws.com/download.elasticsearch.org/lucenesnapshots/00142c9</url>
            <releases><enabled>true</enabled></releases>
            <snapshots><enabled>false</enabled></snapshots>
        </repository>

```

---

<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: [September 7, 2017, 2:56pm UTC](https://discuss.elastic.co/t/is-rest-client-for-elasticsearch-the-only-way-to-go-in-the-future/93233/16 "2017-09-07T14:56:01Z")

</div>

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