# Will the ElasticSearch 5 java rest client have a DSL (in Java)

**URL:** https://discuss.elastic.co/t/will-the-elasticsearch-5-java-rest-client-have-a-dsl-in-java/57591
**Category:** Elasticsearch
**Created:** [August 9, 2016, 12:01pm UTC](https://discuss.elastic.co/t/will-the-elasticsearch-5-java-rest-client-have-a-dsl-in-java/57591 "2016-08-09T12:01:14Z")
**Posts on this page:** 8
**Page:** 1

<div class="post-metadata">

### Author: ![Pieter\_Goddijn](https://avatars.discourse-cdn.com/v4/letter/p/7ea924/32.png) [@Pieter\_Goddijn](https://discuss.elastic.co/u/Pieter_Goddijn)
#### Post date: [August 9, 2016, 12:01pm UTC](https://discuss.elastic.co/t/will-the-elasticsearch-5-java-rest-client-have-a-dsl-in-java/57591/1 "2016-08-09T12:01:14Z")

</div>

We are testing current version of the Java rest client for 5.0.0-alpha-4 and were wondering if there will be a Java DSL for the RestClient (similar to how there is for the old native client), or whether we are expected to create the appropriate json objects (or Jackson classes) needed in the requests ourselves.

---

<div class="post-metadata">

### Author: ![javanna](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/javanna/32/4698_2.png) [@javanna](https://discuss.elastic.co/u/javanna)
#### Post date: [August 9, 2016, 12:24pm UTC](https://discuss.elastic.co/t/will-the-elasticsearch-5-java-rest-client-have-a-dsl-in-java/57591/2 "2016-08-09T12:24:03Z")

</div>

Hi,  
indeed the current java REST client is low-level, it doesn't help with building json, which is something that you should do in your application. We do have plans to fill this gap in the future, see [https://github.com/elastic/elasticsearch/issues/19055](https://github.com/elastic/elasticsearch/issues/19055). That said, even before adding json builders, I think we will add a high level REST client that knows more about the api and exposes methods like `client.index("index", "type", "id", document);`.

Cheers  
Luca

---

<div class="post-metadata">

### Author: ![Pieter\_Goddijn](https://avatars.discourse-cdn.com/v4/letter/p/7ea924/32.png) [@Pieter\_Goddijn](https://discuss.elastic.co/u/Pieter_Goddijn)
#### Post date: [August 9, 2016, 1:09pm UTC](https://discuss.elastic.co/t/will-the-elasticsearch-5-java-rest-client-have-a-dsl-in-java/57591/3 "2016-08-09T13:09:21Z")

</div>

Nice, and thanks for the quick reply.

Judging from the issue this is planned to be included in the GA release of 5.0.0 right?

---

<div class="post-metadata">

### Author: ![javanna](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/javanna/32/4698_2.png) [@javanna](https://discuss.elastic.co/u/javanna)
#### Post date: [August 9, 2016, 1:35pm UTC](https://discuss.elastic.co/t/will-the-elasticsearch-5-java-rest-client-have-a-dsl-in-java/57591/4 "2016-08-09T13:35:28Z")

</div>

That is an optimistic plan I am afraid. The two most important changes in that meta issue were made and will be part of alpha5, there is a good chance that the high level client won't be part of 5.0 GA, not sure yet.

Cheers  
Luca

---

<div class="post-metadata">

### Author: ![ram](https://avatars.discourse-cdn.com/v4/letter/r/b9bd4f/32.png) [@ram](https://discuss.elastic.co/u/ram)
#### Post date: [January 27, 2017, 7:28pm UTC](https://discuss.elastic.co/t/will-the-elasticsearch-5-java-rest-client-have-a-dsl-in-java/57591/5 "2017-01-27T19:28:14Z")

</div>

When can we expect the High Level REST client to be ready?

---

<div class="post-metadata">

### Author: ![jillesvangurp](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jillesvangurp/32/3863_2.png) [@jillesvangurp](https://discuss.elastic.co/u/jillesvangurp)
#### Post date: [April 28, 2017, 7:22am UTC](https://discuss.elastic.co/t/will-the-elasticsearch-5-java-rest-client-have-a-dsl-in-java/57591/6 "2017-04-28T07:22:11Z")

</div>

> **[Elasticsearch Java Clients](https://www.elastic.co/blog/state-of-the-official-elasticsearch-java-clients)**
>
> Java programmers have two choices when communicating with Elasticsearch: they can use either the REST API over HTTP, or the internal Java API used by Elasticsearch itself for node-to-node communication.

Given this article from last December, what is roughly the timeline for the Java REST client to get to a usable state? Is 6.0 a reasonable expectation? The current thin wrapper around httpclient is in my view not really a viable solution for anything since it lacks features. Also the documentation for using this is still largely missing in action, which leads me to wonder if this is at all something that is widely used currently.

I have for the past years hand rolled my own java HTTP rest clients on a couple of projects (most recently last week) and while quite straightforward to do it would be nice to not have that overhead on future projects. I'm currently using okhttp for this, which I find to be a bit easier than htttpclient, which I've also used in the past.

However, the low level http plumbing is not the issue here. What is the issue here is the complete absence of a sane, usable domain model on top. Most projects I know that use java either use the transport client or http with hand crafted models. I've been doing the latter. There are a handful of unofficial clients out there as well with various states of maintenance. I guess most are waiting for movement on the ES front on this.

So, given all that, an update on this would be appreciated.

---

<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: [April 28, 2017, 7:49am UTC](https://discuss.elastic.co/t/will-the-elasticsearch-5-java-rest-client-have-a-dsl-in-java/57591/7 "2017-04-28T07:49:02Z")

</div>

Hey @jillesvangurp

The Advanced REST client is still under work in the master branch (6.0) and more and more things are getting merged as you can see with the following link:

> **[elastic/elasticsearch](https://github.com/elastic/elasticsearch/pulls?q=is%3Apr+label%3A%22%3AJava+High+Level+REST+Client%22+is%3Aclosed)**
>
> elasticsearch - Open Source, Distributed, RESTful Search Engine

BTW documentation has also started but not that much is available yet: [https://www.elastic.co/guide/en/elasticsearch/client/java-rest/master/index.html](https://www.elastic.co/guide/en/elasticsearch/client/java-rest/master/index.html)

I hope this answers some of your questions.

---

<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: [July 5, 2017, 10:00pm UTC](https://discuss.elastic.co/t/will-the-elasticsearch-5-java-rest-client-have-a-dsl-in-java/57591/8 "2017-07-05T22:00:50Z")

</div>


