Java client


(Ali-2) #1

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!


(Shay Banon) #2

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 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!


(eugeis) #3

Super, I will use it also.

On 16 Feb., 21:02, Shay Banon 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 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!


(system) #4