Hello All,
This project provides a simple setup for connecting to Elasticsearch 8 via Spring Boot. The approach involves overriding the default Spring autoconfiguration to create a custom Elasticsearch connection.
The core functionality of the project is to establish a connection to Elasticsearch and retrieve its version. This serves as a basic template for connecting to Elasticsearch, which you can expand and customize based on your needs.
Before starting, you need to define the following properties in your application.properties
spring.elasticsearch.uris=elastic_search_uri
spring.elasticsearch.username=your_userName
spring.elasticsearch.password=your_password
In the spring.elasticsearch.uris property, specify the IP address of your Elasticsearch instance (e.g., 110...*). If you're running Elasticsearch locally, use localhost.
Note : The default Elasticsearch port is 9200, so you don't need to specify it explicitly. Spring Boot will automatically connect to http://<your_elasticsearch_uri>:9200 unless a different port is provided.
Once you've added the properties, the application will automatically establish a connection to your Elasticsearch instance.
![Screenshot 2024-11-29 084348](https://private-user-images.githubusercontent.com/112500121/391155418-312950c4-44b2-4ea0-b8d2-035c04a910c3.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3Mzk1OTkxNTEsIm5iZiI6MTczOTU5ODg1MSwicGF0aCI6Ii8xMTI1MDAxMjEvMzkxMTU1NDE4LTMxMjk1MGM0LTQ0YjItNGVhMC1iOGQyLTAzNWMwNGE5MTBjMy5wbmc_WC1BbXotQWxnb3JpdGhtPUFXUzQtSE1BQy1TSEEyNTYmWC1BbXotQ3JlZGVudGlhbD1BS0lBVkNPRFlMU0E1M1BRSzRaQSUyRjIwMjUwMjE1JTJGdXMtZWFzdC0xJTJGczMlMkZhd3M0X3JlcXVlc3QmWC1BbXotRGF0ZT0yMDI1MDIxNVQwNTU0MTFaJlgtQW16LUV4cGlyZXM9MzAwJlgtQW16LVNpZ25hdHVyZT1lMDk3NDYzN2JhZDM3MzU1M2YzODkwNzQ3YmE3MGE0NGU1NzNhMDg2OGFiZDQxMjM5ZmFiNzg1MWFiNzBlMWZiJlgtQW16LVNpZ25lZEhlYWRlcnM9aG9zdCJ9.-FlKwPxy2LQIMrqptie9H4pxIxqH4J1nbOunzK7JCvg)