{"id":20318582,"url":"https://github.com/ralintuscano/spring-boot-elasticsearch-demo","last_synced_at":"2026-05-07T13:04:59.760Z","repository":{"id":185952491,"uuid":"674372499","full_name":"ralintuscano/spring-boot-elasticsearch-demo","owner":"ralintuscano","description":"This is a demonstration of a Spring Boot application integrated with Elasticsearch.","archived":false,"fork":false,"pushed_at":"2024-05-23T19:55:23.000Z","size":77,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-01-14T13:19:29.529Z","etag":null,"topics":["elasticsearch","lombok","rest-api","spring-boot"],"latest_commit_sha":null,"homepage":"","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ralintuscano.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2023-08-03T19:35:48.000Z","updated_at":"2024-05-23T19:55:26.000Z","dependencies_parsed_at":null,"dependency_job_id":"c2c15c02-7fff-42dc-a3e1-e7641c58226a","html_url":"https://github.com/ralintuscano/spring-boot-elasticsearch-demo","commit_stats":null,"previous_names":["ralintuscano/spring-boot-elasticsearch-demo"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ralintuscano%2Fspring-boot-elasticsearch-demo","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ralintuscano%2Fspring-boot-elasticsearch-demo/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ralintuscano%2Fspring-boot-elasticsearch-demo/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ralintuscano%2Fspring-boot-elasticsearch-demo/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ralintuscano","download_url":"https://codeload.github.com/ralintuscano/spring-boot-elasticsearch-demo/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":241819340,"owners_count":20025299,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["elasticsearch","lombok","rest-api","spring-boot"],"created_at":"2024-11-14T18:40:16.120Z","updated_at":"2025-10-09T14:52:39.454Z","avatar_url":"https://github.com/ralintuscano.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Spring Boot Elasticsearch Demo\n\nThis project shows how to build a Spring Boot application using Elasticsearch for storage and retrieval of data.\n\n## Built With\n- Java 17\n- Spring Boot 3.1.2\n- Spring Data Elasticsearch\n- Elasticsearch 7.16.1\n\n## Usage \n\nThe application exposes REST endpoints for CRUD operations on a `Book` entity that is persisted in Elasticsearch.\n\nSome key components:\n\n- Spring Data Elasticsearch - Provides integration with Elasticsearch\n- BookRepository - Interface extending ElasticsearchRepository for CRUD ops  \n- BookService - Business logic for creating/updating/deleting Books\n- BookController - REST controller exposing endpoints\n\n## Running Locally\n\n### Start Elasticsearch\n\nDownload and install Elasticsearch locally, then start it:\n\n### Step 1: Pull Elasticsearch Image\n```\ndocker pull docker.elastic.co/elasticsearch/elasticsearch:7.16.1\n```\n### Step 2: Run Elasticsearch Container\n```\ndocker run -d --name elasticsearch -p 9200:9200 -p 9300:9300 \\\n-e \"discovery.type=single-node\" \\\ndocker.elastic.co/elasticsearch/elasticsearch:7.16.1\n```\n### Step 3: Access Elasticsearch\nAccess the Elasticsearch REST API at `http://localhost:9200` to interact with Elasticsearch and perform various operations.\n\n### Step 4: Stop and Remove Container\n```\ndocker stop elasticsearch\ndocker rm elasticsearch\n```\nElasticsearch will run on port 9200.\n\n### Build Spring Boot App\n```\nmvn clean install\n```\n\n### Run Spring Boot App\n\nThe app will run on port 8080.\n\n## Usage\n\nThe REST endpoints support CRUD operations for the `Book` entity:\n\n### Create a Book\n```\ncurl -X POST \"http://localhost:8080/books\" \\\n-H \"Content-Type: application/json\" \\\n-d '{\"title\":\"New Book\",\"author\":\"John Doe\",\"description\":\"A new book\"}'\n```\n\n### Get a Book by ID\n```\ncurl -X GET \"http://localhost:8080/books/{id}\"\n```\n### Update a Book\n```\ncurl -X PUT \"http://localhost:8080/books/{id}\" \\\n-H \"Content-Type: application/json\" \\\n-d '{\"title\":\"Updated Book\",\"author\":\"Jane Smith\",\"description\":\"An updated book\"}'\n```\n### Delete a Book\n```\ncurl -X DELETE \"http://localhost:8080/books/{id}\"\n```\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fralintuscano%2Fspring-boot-elasticsearch-demo","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fralintuscano%2Fspring-boot-elasticsearch-demo","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fralintuscano%2Fspring-boot-elasticsearch-demo/lists"}