# Guides on getting Elastic 8 working with a Java backend?

**URL:** <https://discuss.elastic.co/t/guides-on-getting-elastic-8-working-with-a-java-backend/348765>\
**Category:** Elasticsearch\
**Created:** [December 6, 2023, 11:41pm UTC](https://discuss.elastic.co/t/guides-on-getting-elastic-8-working-with-a-java-backend/348765 "2023-12-06T23:41:43Z")\
**Posts on this page:** 12\
**Page:** 1

<div class="post-metadata">

**Author:** ![DenverCoder9](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/denvercoder9/32/129159_2.png) [@DenverCoder9](https://discuss.elastic.co/u/DenverCoder9)\
**Post date:** [December 6, 2023, 11:41pm UTC](https://discuss.elastic.co/t/guides-on-getting-elastic-8-working-with-a-java-backend/348765/1 "2023-12-06T23:41:43Z")

</div>

Hello. Been working in Java to try getting Elasticsearch up and working in a Java backend and not having good luck with finding examples of how to have it working.

A lot of the materials I've seen use RestHighLevelClient which is deprecated. And when looking at the newer examples from [here](https://www.elastic.co/guide/en/elasticsearch/client/java-api-client/current/connecting.html) I'm having a hard time understanding which files those snippets are meant to be in.

Plus the api key portion of that example is also something I'm having difficulty with. I tried using Postman to send a request to localhost:9200/\_security/api\_key but got back and error due ot missing credentials for REST request. Are there additional parameters I need to include there to get the key?

My overall goal here is to create a Java backend with a RESTful API that can get called from a frontend application. The frontend will take care of user interface and creating new documents. The backend will then take care of getting information from Elasticsearch and then sending it back.

So what are some good resources to further help in figuring this out? Or am I going down a wrong path? (And apologies if I have the forum/tag wrong.)

---

<div class="post-metadata">

**Author:** ![DenverCoder9](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/denvercoder9/32/129159_2.png) [@DenverCoder9](https://discuss.elastic.co/u/DenverCoder9)\
**Post date:** [December 7, 2023, 2:16pm UTC](https://discuss.elastic.co/t/guides-on-getting-elastic-8-working-with-a-java-backend/348765/2 "2023-12-07T14:16:52Z")

</div>

Edit: One thing to add, I'm specifically using the Springboot framework.

---

<div class="post-metadata">

**Author:** ![Sean\_Story](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/sean_story/32/69987_2.png) [@Sean\_Story](https://discuss.elastic.co/u/Sean_Story)\
**Post date:** [December 7, 2023, 3:50pm UTC](https://discuss.elastic.co/t/guides-on-getting-elastic-8-working-with-a-java-backend/348765/3 "2023-12-07T15:50:02Z")

</div>

Hi @DenverCoder9,

Sounds like you're trying to run before you've learned to walk. 🙂

I suggest you focus first on understanding Elasticearch, how it works, and how to interact with it just through a pure REST interface (cURL or Postman) and _then_ worry about the Java language client and how to integrate with Spring Boot.

If you've got Elasticsearch running but can't authenticate yet, check out: [Built-in users | Elasticsearch Guide [8.11] | Elastic](https://www.elastic.co/guide/en/elasticsearch/reference/current/built-in-users.html#bootstrap-elastic-passwords)

Most folks make their first Elasticsearch requests using the `elastic` built-in user, and basic authentication. With cURL, that'll look like:

```auto
curl -XGET -u elastic:<password> localhost:9200

```

I strongly recommend you also set up Kibana, which will give you a UI, so that you can log in through your browser with that same username/password and explore creating API keys, indices, using Kibana dev tools, etc. At that point, you could follow this getting started guide: [Quick start | Elasticsearch Guide [8.11] | Elastic](https://www.elastic.co/guide/en/elasticsearch/reference/current/getting-started.html#send-requests-to-elasticsearch)

---

<div class="post-metadata">

**Author:** ![stephenb](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/stephenb/32/40856_2.png) [@stephenb](https://discuss.elastic.co/u/stephenb)\
**Post date:** [December 7, 2023, 4:07pm UTC](https://discuss.elastic.co/t/guides-on-getting-elastic-8-working-with-a-java-backend/348765/4 "2023-12-07T16:07:54Z")

</div>

Hi @DenverCoder9 Welcome to the community...

Also did you see the basic examples here?

> **[Using the Java API Client | Elasticsearch Java API Client \[8.11\] | Elastic](https://www.elastic.co/guide/en/elasticsearch/client/java-api-client/current/usage.html)**

There are samples for

> - [Indexing single documents](https://www.elastic.co/guide/en/elasticsearch/client/java-api-client/current/indexing.html)
> - [Bulk: indexing multiple documents](https://www.elastic.co/guide/en/elasticsearch/client/java-api-client/current/indexing-bulk.html)
> - [Reading documents by id](https://www.elastic.co/guide/en/elasticsearch/client/java-api-client/current/reading.html)
> - [Searching for documents](https://www.elastic.co/guide/en/elasticsearch/client/java-api-client/current/searching.html)
> - [Aggregations](https://www.elastic.co/guide/en/elasticsearch/client/java-api-client/current/aggregations.html)

---

<div class="post-metadata">

**Author:** ![DenverCoder9](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/denvercoder9/32/129159_2.png) [@DenverCoder9](https://discuss.elastic.co/u/DenverCoder9)\
**Post date:** [December 7, 2023, 5:04pm UTC](https://discuss.elastic.co/t/guides-on-getting-elastic-8-working-with-a-java-backend/348765/5 "2023-12-07T17:04:30Z")

</div>

> [@Sean\_Story](#):
>
> Sounds like you're trying to run before you've learned to walk. 🙂

Definitely feels like it. 🙂 Overall goal in the end is a fullstack app searching .docx, .pdf, .txt etc. So tried going a bit ahead.

I do have Kibana already so at least I've got that. But definitely looks like I'll have to read through that guide and stephen's resource to get back to basics before trying next steps. Thank you very much for the help.

In general, would it be better to open another thread if I have more questions soon or to keep on with this one? (Not sure on all the etiquette of this forum.)

---

<div class="post-metadata">

**Author:** ![stephenb](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/stephenb/32/40856_2.png) [@stephenb](https://discuss.elastic.co/u/stephenb)\
**Post date:** [December 7, 2023, 5:23pm UTC](https://discuss.elastic.co/t/guides-on-getting-elastic-8-working-with-a-java-backend/348765/6 "2023-12-07T17:23:38Z")

</div>

> [@DenverCoder9](#):
>
> Overall goal in the end is a fullstack app searching .docx, .pdf, .txt etc. So tried going a bit ahead.

You know you do not need to build a full java app for this ... this is exactly What The Enterprise Search / App Search does OOTB for you 🙂

Unless you are doing this for a learning exercise...

What version are on?

---

<div class="post-metadata">

**Author:** ![DenverCoder9](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/denvercoder9/32/129159_2.png) [@DenverCoder9](https://discuss.elastic.co/u/DenverCoder9)\
**Post date:** [December 7, 2023, 7:16pm UTC](https://discuss.elastic.co/t/guides-on-getting-elastic-8-working-with-a-java-backend/348765/7 "2023-12-07T19:16:33Z")

</div>

> [@stephenb](#):
>
> You know you do not need to build a full java app for this ... this is exactly What The Enterprise Search / App Search does OOTB for you 🙂

Where would I read more about that? Is this the correct link? [https://www.elastic.co/guide/en/enterprise-search/current/index.html](https://www.elastic.co/guide/en/enterprise-search/current/index.html)

I'll need to see if that fulfills the requirements doc. It's been a small team of us, mostly new to the field, working on it so we've been having some difficulties figuring out which direction to go.

Edit: For Elasticsearch we're using version 8.1

---

<div class="post-metadata">

**Author:** ![stephenb](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/stephenb/32/40856_2.png) [@stephenb](https://discuss.elastic.co/u/stephenb)\
**Post date:** [December 7, 2023, 7:22pm UTC](https://discuss.elastic.co/t/guides-on-getting-elastic-8-working-with-a-java-backend/348765/8 "2023-12-07T19:22:57Z")

</div>

> [@DenverCoder9](#):
>
> For Elasticsearch we're using version 8.1

8.1 or 8.11?

Make sure you are looking at the right docs .. .but Yes, under Enterprise Search.

Technically Workplace Search has the .pdf / word connectors etc..

This is all going under a bit of change right now so just want to be sure which version you are on... and what you have installed?

> ### Enterprise Search
> 
> - [Enterprise Search Guide [8.11]](https://www.elastic.co/guide/en/enterprise-search/current/index.html) — [other versions](https://www.elastic.co/guide/en/enterprise-search/index.html)
> - [Workplace Search Guide [8.11]](https://www.elastic.co/guide/en/workplace-search/current/index.html) — [other versions](https://www.elastic.co/guide/en/workplace-search/index.html)
> - [App Search Guide [8.11]](https://www.elastic.co/guide/en/app-search/current/index.html) — [other versions](https://www.elastic.co/guide/en/app-search/index.html)

---

<div class="post-metadata">

**Author:** ![Sean\_Story](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/sean_story/32/69987_2.png) [@Sean\_Story](https://discuss.elastic.co/u/Sean_Story)\
**Post date:** [December 7, 2023, 8:10pm UTC](https://discuss.elastic.co/t/guides-on-getting-elastic-8-working-with-a-java-backend/348765/9 "2023-12-07T20:10:06Z")

</div>

> [@DenverCoder9](#):
>
> In general, would it be better to open another thread if I have more questions soon or to keep on with this one? (Not sure on all the etiquette of this forum.)

This is a casual place. BUT, if you think you're going to have a lot of questions and need some more rapid back-and-forth, might I suggest you check out our [community slack](https://ela.st/slack)? Specifically if you end up trying out App Search or one of our document store connectors, you can find the relevant team (my team) in the `#search-enterprise` channel.

---

<div class="post-metadata">

**Author:** ![DenverCoder9](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/denvercoder9/32/129159_2.png) [@DenverCoder9](https://discuss.elastic.co/u/DenverCoder9)\
**Post date:** [December 7, 2023, 8:22pm UTC](https://discuss.elastic.co/t/guides-on-getting-elastic-8-working-with-a-java-backend/348765/10 "2023-12-07T20:22:05Z")

</div>

> [@stephenb](#):
>
> 8.1 or 8.11?

Looking at the full name, 8.10.4 would be the one and then Kibana is 8.10.2

@Sean, thanks for the Slack link. I'll keep it in mind.

---

<div class="post-metadata">

**Author:** ![stephenb](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/stephenb/32/40856_2.png) [@stephenb](https://discuss.elastic.co/u/stephenb)\
**Post date:** [December 7, 2023, 8:44pm UTC](https://discuss.elastic.co/t/guides-on-getting-elastic-8-working-with-a-java-backend/348765/11 "2023-12-07T20:44:26Z")

</div>

So look at the links I provided above and there is a little Version Selector and make sure you look at the correct docs...

You might as well upgrade to 8.11.2 soon ... anyways 🙂

---

<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:** [January 4, 2024, 8:44pm UTC](https://discuss.elastic.co/t/guides-on-getting-elastic-8-working-with-a-java-backend/348765/12 "2024-01-04T20:44:50Z")

</div>

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