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 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.)
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.
Most folks make their first Elasticsearch requests using the elastic built-in user, and basic authentication. With cURL, that'll look like:
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
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.)
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.
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? 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.
Apache, Apache Lucene, Apache Hadoop, Hadoop, HDFS and the yellow elephant
logo are trademarks of the
Apache Software Foundation
in the United States and/or other countries.