# Java client

**URL:** <https://discuss.elastic.co/t/java-client/2814>\
**Category:** Elasticsearch\
**Created:** [February 16, 2010, 4:39pm UTC](https://discuss.elastic.co/t/java-client/2814 "2010-02-16T16:39:27Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Ali\_2](https://avatars.discourse-cdn.com/v4/letter/a/f475e1/32.png) [@Ali\_2](https://discuss.elastic.co/u/Ali_2)\
**Post date:** [February 16, 2010, 4:39pm UTC](https://discuss.elastic.co/t/java-client/2814/1 "2010-02-16T16:39:27Z")

</div>

Hey,

I have recently started using Lucene/Solr for indexing my documents  
and building a search engine! I just found out about this project  
through a friend and it looks just what I need (in particular its  
comprehensive JSON API).

However, with Solr, I am working with SolrJ (Java client for solr). I  
was just wondering if Elastic Search has any Java client for  
integrating it in my java application.

Perhaps a demo/tutorial for doing this would be really helpful.

Thanks in advance!

- Ali

\*P.S: I must say that the website is awesome!

---

<div class="post-metadata">

**Author:** ![kimchy](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/kimchy/32/44952_2.png) [@kimchy](https://discuss.elastic.co/u/kimchy)\
**Post date:** [February 16, 2010, 8:02pm UTC](https://discuss.elastic.co/t/java-client/2814/2 "2010-02-16T20:02:45Z")

</div>

First of all, thanks about the website :).

Yes, a Java API is in the works (actually, it is there on master, though not  
heavily javadoc'ed yet, and no reference site docs). One of the benefits of  
the Java API is that it does not use JSON, its a low level TCP communication  
with highly optimized serialization. Its got a full Java DSL for all  
operations.

I plan to release 0.5.0 in a couple of weeks. If you can't wait, get master  
and build it, and in Java do:

Server server = ServerBuilder.serverBuilder().server();  
Client client = server.client();

Client has all the APIs you need, here is an example for index:

IndexReponse response =

client.index(indexRequest("test").type("type1").id("1").source(jsonBuilder().startObject().field("value",  
"aaa").endObject())).actionGet();

The nice thing is that the Java API is completely async (you get an  
ActionFuture back, and can pass a listener).

-shay.banon

On Tue, Feb 16, 2010 at 6:39 PM, Ali [cs.muneebali@googlemail.com](mailto:cs.muneebali@googlemail.com) wrote:

> Hey,
> 
> I have recently started using Lucene/Solr for indexing my documents  
> and building a search engine! I just found out about this project  
> through a friend and it looks just what I need (in particular its  
> comprehensive JSON API).
> 
> However, with Solr, I am working with SolrJ (Java client for solr). I  
> was just wondering if Elastic Search has any Java client for  
> integrating it in my java application.
> 
> Perhaps a demo/tutorial for doing this would be really helpful.
> 
> Thanks in advance!
> 
> - Ali
> 
> \*P.S: I must say that the website is awesome!

---

<div class="post-metadata">

**Author:** ![eugeis](https://avatars.discourse-cdn.com/v4/letter/e/278dde/32.png) [@eugeis](https://discuss.elastic.co/u/eugeis)\
**Post date:** [February 17, 2010, 8:39am UTC](https://discuss.elastic.co/t/java-client/2814/3 "2010-02-17T08:39:03Z")

</div>

Super, I will use it also.

On 16 Feb., 21:02, Shay Banon [shay.ba...@elasticsearch.com](mailto:shay.ba...@elasticsearch.com) wrote:

> First of all, thanks about the website :).
> 
> Yes, a Java API is in the works (actually, it is there on master, though not  
> heavily javadoc'ed yet, and no reference site docs). One of the benefits of  
> the Java API is that it does not use JSON, its a low level TCP communication  
> with highly optimized serialization. Its got a full Java DSL for all  
> operations.
> 
> I plan to release 0.5.0 in a couple of weeks. If you can't wait, get master  
> and build it, and in Java do:
> 
> Server server = ServerBuilder.serverBuilder().server();  
> Client client = server.client();
> 
> Client has all the APIs you need, here is an example for index:
> 
> IndexReponse response =
> 
> client.index(indexRequest("test").type("type1").id("1").source(jsonBuilder().startObject().field("value",  
> "aaa").endObject())).actionGet();
> 
> The nice thing is that the Java API is completely async (you get an  
> ActionFuture back, and can pass a listener).
> 
> -shay.banon
> 
> On Tue, Feb 16, 2010 at 6:39 PM, Ali [cs.muneeb...@googlemail.com](mailto:cs.muneeb...@googlemail.com) wrote:
> 
> > Hey,
> 
> > I have recently started using Lucene/Solr for indexing my documents  
> > and building a search engine! I just found out about this project  
> > through a friend and it looks just what I need (in particular its  
> > comprehensive JSON API).
> 
> > However, with Solr, I am working with SolrJ (Java client for solr). I  
> > was just wondering if Elastic Search has any Java client for  
> > integrating it in my java application.
> 
> > Perhaps a demo/tutorial for doing this would be really helpful.
> 
> > Thanks in advance!
> > 
> > - Ali
> 
> > \*P.S: I must say that the website is awesome!

---

<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 6, 2017, 4:25am UTC](https://discuss.elastic.co/t/java-client/2814/4 "2017-07-06T04:25:41Z")

</div>


