# Tutorial on Java interface to ElasticSearch?

**URL:** <https://discuss.elastic.co/t/tutorial-on-java-interface-to-elasticsearch/18464>\
**Category:** Elasticsearch\
**Created:** [July 3, 2014, 2:08pm UTC](https://discuss.elastic.co/t/tutorial-on-java-interface-to-elasticsearch/18464 "2014-07-03T14:08:11Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Alain\_Desilets](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/alain_desilets/32/29314_2.png) [@Alain\_Desilets](https://discuss.elastic.co/u/Alain_Desilets)\
**Post date:** [July 3, 2014, 2:08pm UTC](https://discuss.elastic.co/t/tutorial-on-java-interface-to-elasticsearch/18464/1 "2014-07-03T14:08:11Z")

</div>

I am a total newbie to ElasticSearch, and I have been using the following  
tutorial to get started:

[http://www.elasticsearch.org/guide/en/elasticsearch/guide/current/getting-started.html](http://www.elasticsearch.org/guide/en/elasticsearch/guide/current/getting-started.html)

I'm finding it really easy to follow and informative.

Now, I want to use the Java API to write a Java program that uses  
ElasticSearch, but I can't find an equally helpful tutorial for the Java  
API. I am surfing and searching through the API documentation, but can't  
figure out how to do even easy operations like: create an index, put a  
document into it, retrieve it, etc...

Of course, I could always write methods that send HTTP requests, at which  
point I could rely on what I learned through the above tutorial. But I  
would prefer to use a more direct link provided by the Java API.

Does someone know of a good tutorial on the Java API?

Thx.

Alain Désilets

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/b0723c1e-8f14-4df2-a80e-a4a4646503a0%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/b0723c1e-8f14-4df2-a80e-a4a4646503a0%40googlegroups.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<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:** [July 3, 2014, 2:10pm UTC](https://discuss.elastic.co/t/tutorial-on-java-interface-to-elasticsearch/18464/2 "2014-07-03T14:10:13Z")

</div>

Hey Alain,

You can have a look at this: [https://github.com/elasticsearchfr/hands-on/tree/answers](https://github.com/elasticsearchfr/hands-on/tree/answers)  
[http://www.elasticsearch.org/guide/en/elasticsearch/client/java-api/current/index.html](http://www.elasticsearch.org/guide/en/elasticsearch/client/java-api/current/index.html)

I hope this could help.

--  
David Pilato | Technical Advocate | [Elasticsearch.com](http://Elasticsearch.com)  
@dadoonet | @elasticsearchfr

Le 3 juillet 2014 à 16:08:15, Alain Désilets ([alaindesilets0@gmail.com](mailto:alaindesilets0@gmail.com)) a écrit:

I am a total newbie to ElasticSearch, and I have been using the following tutorial to get started:

[http://www.elasticsearch.org/guide/en/elasticsearch/guide/current/getting-started.html](http://www.elasticsearch.org/guide/en/elasticsearch/guide/current/getting-started.html)

I'm finding it really easy to follow and informative.

Now, I want to use the Java API to write a Java program that uses ElasticSearch, but I can't find an equally helpful tutorial for the Java API. I am surfing and searching through the API documentation, but can't figure out how to do even easy operations like: create an index, put a document into it, retrieve it, etc...

Of course, I could always write methods that send HTTP requests, at which point I could rely on what I learned through the above tutorial. But I would prefer to use a more direct link provided by the Java API.

Does someone know of a good tutorial on the Java API?

Thx.

## Alain Désilets

You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/b0723c1e-8f14-4df2-a80e-a4a4646503a0%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/b0723c1e-8f14-4df2-a80e-a4a4646503a0%40googlegroups.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/etPan.53b56447.431bd7b7.cc4%40MacBook-Air-de-David.local](https://groups.google.com/d/msgid/elasticsearch/etPan.53b56447.431bd7b7.cc4%40MacBook-Air-de-David.local).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<div class="post-metadata">

**Author:** ![Ivan](https://avatars.discourse-cdn.com/v4/letter/i/df788c/32.png) [@Ivan](https://discuss.elastic.co/u/Ivan)\
**Post date:** [July 3, 2014, 4:20pm UTC](https://discuss.elastic.co/t/tutorial-on-java-interface-to-elasticsearch/18464/3 "2014-07-03T16:20:05Z")

</div>

Currently the best way to learn the Java API is to view the Elasticsearch  
search code.

All the REST examples use the Java API underneath, so you can see how the  
Java API is used by viewing a REST action such as RestSearchAction,  
RestIndexAction, etc...

[https://github.com/elasticsearch/elasticsearch/tree/master/src/main/java/org/elasticsearch/rest/action](https://github.com/elasticsearch/elasticsearch/tree/master/src/main/java/org/elasticsearch/rest/action)

The unit tests are another great place to see how the Java API is used,  
with actual examples:

[https://github.com/elasticsearch/elasticsearch/tree/master/src/test/java/org/elasticsearch](https://github.com/elasticsearch/elasticsearch/tree/master/src/test/java/org/elasticsearch)

Cheers,

Ivan

On Thu, Jul 3, 2014 at 7:08 AM, Alain Désilets [alaindesilets0@gmail.com](mailto:alaindesilets0@gmail.com)  
wrote:

> I am a total newbie to Elasticsearch, and I have been using the following  
> tutorial to get started:
> 
> [Elasticsearch Platform — Find real-time answers at scale | Elastic](http://www.elasticsearch.org/guide/en/elasticsearch/guide/current/getting-started.html)
> 
> I'm finding it really easy to follow and informative.
> 
> Now, I want to use the Java API to write a Java program that uses  
> Elasticsearch, but I can't find an equally helpful tutorial for the Java  
> API. I am surfing and searching through the API documentation, but can't  
> figure out how to do even easy operations like: create an index, put a  
> document into it, retrieve it, etc...
> 
> Of course, I could always write methods that send HTTP requests, at which  
> point I could rely on what I learned through the above tutorial. But I  
> would prefer to use a more direct link provided by the Java API.
> 
> Does someone know of a good tutorial on the Java API?
> 
> Thx.
> 
> Alain Désilets
> 
> --  
> You received this message because you are subscribed to the Google Groups  
> "elasticsearch" group.  
> To unsubscribe from this group and stop receiving emails from it, send an  
> email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
> To view this discussion on the web visit  
> [https://groups.google.com/d/msgid/elasticsearch/b0723c1e-8f14-4df2-a80e-a4a4646503a0%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/b0723c1e-8f14-4df2-a80e-a4a4646503a0%40googlegroups.com)  
> [https://groups.google.com/d/msgid/elasticsearch/b0723c1e-8f14-4df2-a80e-a4a4646503a0%40googlegroups.com?utm\_medium=email&utm\_source=footer](https://groups.google.com/d/msgid/elasticsearch/b0723c1e-8f14-4df2-a80e-a4a4646503a0%40googlegroups.com?utm_medium=email&utm_source=footer)  
> .  
> For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/CALY%3DcQC7nMYGejLfaNkJCjPLppf-or7axq6G97TKewPH5r%3DZfg%40mail.gmail.com](https://groups.google.com/d/msgid/elasticsearch/CALY%3DcQC7nMYGejLfaNkJCjPLppf-or7axq6G97TKewPH5r%3DZfg%40mail.gmail.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<div class="post-metadata">

**Author:** ![Alain\_Desilets](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/alain_desilets/32/29314_2.png) [@Alain\_Desilets](https://discuss.elastic.co/u/Alain_Desilets)\
**Post date:** [July 3, 2014, 8:26pm UTC](https://discuss.elastic.co/t/tutorial-on-java-interface-to-elasticsearch/18464/4 "2014-07-03T20:26:28Z")

</div>

Thanks David. This is exactly what I was looking for.

Alain

On Thursday, 3 July 2014 10:10:31 UTC-4, David Pilato wrote:

> Hey Alain,
> 
> You can have a look at this:  
> [GitHub - elasticsearchfr/hands-on at answers](https://github.com/elasticsearchfr/hands-on/tree/answers)
> 
> [Elasticsearch Platform — Find real-time answers at scale | Elastic](http://www.elasticsearch.org/guide/en/elasticsearch/client/java-api/current/index.html)
> 
> I hope this could help.
> 
> --  
> _David Pilato_ | _Technical Advocate_ | _[Elasticsearch.com](http://Elasticsearch.com)_  
> @dadoonet [https://twitter.com/dadoonet](https://twitter.com/dadoonet) | @elasticsearchfr  
> [https://twitter.com/elasticsearchfr](https://twitter.com/elasticsearchfr)
> 
> Le 3 juillet 2014 à 16:08:15, Alain Désilets ([alainde...@gmail.com](mailto:alainde...@gmail.com)  
> \<javascript:\>) a écrit:
> 
> I am a total newbie to Elasticsearch, and I have been using the following  
> tutorial to get started:
> 
> [Elasticsearch Platform — Find real-time answers at scale | Elastic](http://www.elasticsearch.org/guide/en/elasticsearch/guide/current/getting-started.html)
> 
> I'm finding it really easy to follow and informative.
> 
> Now, I want to use the Java API to write a Java program that uses  
> Elasticsearch, but I can't find an equally helpful tutorial for the Java  
> API. I am surfing and searching through the API documentation, but can't  
> figure out how to do even easy operations like: create an index, put a  
> document into it, retrieve it, etc...
> 
> Of course, I could always write methods that send HTTP requests, at which  
> point I could rely on what I learned through the above tutorial. But I  
> would prefer to use a more direct link provided by the Java API.
> 
> Does someone know of a good tutorial on the Java API?
> 
> Thx.
> 
> ## Alain Désilets
> 
> You received this message because you are subscribed to the Google Groups  
> "elasticsearch" group.  
> To unsubscribe from this group and stop receiving emails from it, send an  
> email to [elasticsearc...@googlegroups.com](mailto:elasticsearc...@googlegroups.com) \<javascript:\>.  
> To view this discussion on the web visit  
> [https://groups.google.com/d/msgid/elasticsearch/b0723c1e-8f14-4df2-a80e-a4a4646503a0%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/b0723c1e-8f14-4df2-a80e-a4a4646503a0%40googlegroups.com)  
> [https://groups.google.com/d/msgid/elasticsearch/b0723c1e-8f14-4df2-a80e-a4a4646503a0%40googlegroups.com?utm\_medium=email&utm\_source=footer](https://groups.google.com/d/msgid/elasticsearch/b0723c1e-8f14-4df2-a80e-a4a4646503a0%40googlegroups.com?utm_medium=email&utm_source=footer)  
> .  
> For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/9732af28-e9a7-4bf5-92e2-7d70bfbad26a%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/9732af28-e9a7-4bf5-92e2-7d70bfbad26a%40googlegroups.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<div class="post-metadata">

**Author:** ![Adrian\_2](https://avatars.discourse-cdn.com/v4/letter/a/c57346/32.png) [@Adrian\_2](https://discuss.elastic.co/u/Adrian_2)\
**Post date:** [July 8, 2014, 10:21pm UTC](https://discuss.elastic.co/t/tutorial-on-java-interface-to-elasticsearch/18464/5 "2014-07-08T22:21:25Z")

</div>

On Thu, Jul 03, 2014 at 09:20:05AM -0700, Ivan Brusic wrote:

Ivan,

> Currently the best way to learn the Java API is to view the Elasticsearch  
> search code.

Or just sift through the generated Java API Documentation. You can find some at: [http://javadoc.kyubu.de/elasticsearch](http://javadoc.kyubu.de/elasticsearch).

Best, Adrian

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/20140708222125.GA25315%40server1.850nm.net](https://groups.google.com/d/msgid/elasticsearch/20140708222125.GA25315%40server1.850nm.net).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<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, 1:17am UTC](https://discuss.elastic.co/t/tutorial-on-java-interface-to-elasticsearch/18464/6 "2017-07-06T01:17:13Z")

</div>


