{"id":16891601,"url":"https://github.com/kasramp/spring-data-elasticsearch-example","last_synced_at":"2025-05-07T12:24:50.155Z","repository":{"id":73527934,"uuid":"183939336","full_name":"kasramp/Spring-Data-ElasticSearch-Example","owner":"kasramp","description":"An example of Spring Data Elasticsearch with Spring Boot 3 and Elasticsearch version 8","archived":false,"fork":false,"pushed_at":"2024-06-26T20:26:18.000Z","size":53,"stargazers_count":32,"open_issues_count":2,"forks_count":35,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-31T10:03:46.533Z","etag":null,"topics":["docker-compose","junit5","spring","spring-boot","spring-data","spring-data-elasticsearch","springboot3","springboot3-x","springframework","testcontainers"],"latest_commit_sha":null,"homepage":"https://geekyhacker.com/getting-started-with-spring-data-elasticsearch/","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/kasramp.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null},"funding":{"github":"kasramp","custom":"https://paypal.me/Madadipouya"}},"created_at":"2019-04-28T17:34:50.000Z","updated_at":"2025-01-09T01:51:25.000Z","dependencies_parsed_at":"2024-01-05T11:45:01.943Z","dependency_job_id":"fbd7ced0-085a-47d8-9c88-934c8b27b74f","html_url":"https://github.com/kasramp/Spring-Data-ElasticSearch-Example","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kasramp%2FSpring-Data-ElasticSearch-Example","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kasramp%2FSpring-Data-ElasticSearch-Example/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kasramp%2FSpring-Data-ElasticSearch-Example/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kasramp%2FSpring-Data-ElasticSearch-Example/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/kasramp","download_url":"https://codeload.github.com/kasramp/Spring-Data-ElasticSearch-Example/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252874995,"owners_count":21817936,"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":["docker-compose","junit5","spring","spring-boot","spring-data","spring-data-elasticsearch","springboot3","springboot3-x","springframework","testcontainers"],"created_at":"2024-10-13T17:08:04.420Z","updated_at":"2025-05-07T12:24:50.111Z","avatar_url":"https://github.com/kasramp.png","language":"Java","readme":"# Spring Data Elasticsearch Example with Spring Boot 3 and ElasticSearch 8\n\n## Introduction\n\nThis example demonstrates how to use Spring Data Elasticsearch to do simple CRUD operations.\n\nYou can find the tutorial about this example at this link: [Getting started with Spring Data Elasticsearch](https://www.geekyhacker.com/getting-started-with-spring-data-elasticsearch/)\n\nFor this example, we created a Book controller that allows doing the following operations with Elasticsearch:\n\n- Get the list of all books\n- Create a book\n- Update a book by Id\n- Delete a book by Id\n- Search for a book by ISBN\n- Fuzzy search for books by author and title\n\n## How to run\n\n### Spring Boot 3.1\n\nSince this project uses Spring Boot 3.1, all you need to do is to run the application:\n\n```bash\n$ ./mvnw spring-boot:run\n```\n\nSpring Boot automatically detects the `docker-compose` file and starts the Elasticsearch container.\n\n### Spring Boot 3.0 and prior\n\nThe older version of this project uses Spring Boot 3.0 which does not have Spring Boot Docker Compose integration.\n\nTo run an older version of the application, the first thing to do is to start Elasticsearch. For that, you can use the `docker-compose` file in this project  and run it like this:\n\n```bash\n$ docker-compose -f docker-compose up -d\n``` \n\nIt brings Elasticsearch up on a single node cluster with the cluster name `elasticsearch`.\n\nThen you can run the application like below:\n\n```bash\n$ ./mvnw spring-boot:run\n```\n\nIf your Elasticsearch URI is not `localhost` is different simply override the following environment variable:\n\n- `ES_URI`\n\nOnce everything is up and running open the browser and go to [http://localhost:8080](http://localhost:8080). You should see Swagger to interact with.\n\n## Run Testcontainers tests\n\nThe integration tests are written relying on [Testcontainers](https://www.testcontainers.org/) to spin up Elasticsearch on the spot and run tests against it.\nTo know more about container testing read this tutorial: [Integration test with Testcontainers in Java](https://www.geekyhacker.com/integration-test-with-testcontainers-in-java/)\n\nTo run the integration test (using Testcontainers) just run the below command:\n\n```bash\n$ mvn clean verify\n```\n\nMake sure you have your docker running.\n","funding_links":["https://github.com/sponsors/kasramp","https://paypal.me/Madadipouya"],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkasramp%2Fspring-data-elasticsearch-example","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkasramp%2Fspring-data-elasticsearch-example","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkasramp%2Fspring-data-elasticsearch-example/lists"}