{"id":18291091,"url":"https://github.com/hakdogan/hibernate-search","last_synced_at":"2025-08-26T16:21:18.613Z","repository":{"id":145613037,"uuid":"316972281","full_name":"hakdogan/hibernate-search","owner":"hakdogan","description":"Hibernate Search is a library that allows keeping your local Lucene indexes or ElasticSearch cluster in sync with your Database","archived":false,"fork":false,"pushed_at":"2021-02-06T14:18:52.000Z","size":64,"stargazers_count":3,"open_issues_count":0,"forks_count":2,"subscribers_count":2,"default_branch":"quarkus","last_synced_at":"2025-08-23T09:40:05.583Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/hakdogan.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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,"zenodo":null}},"created_at":"2020-11-29T14:42:59.000Z","updated_at":"2024-02-29T15:33:51.000Z","dependencies_parsed_at":null,"dependency_job_id":"c562777e-9033-484f-a675-c5b81d09dd5b","html_url":"https://github.com/hakdogan/hibernate-search","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/hakdogan/hibernate-search","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hakdogan%2Fhibernate-search","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hakdogan%2Fhibernate-search/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hakdogan%2Fhibernate-search/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hakdogan%2Fhibernate-search/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/hakdogan","download_url":"https://codeload.github.com/hakdogan/hibernate-search/tar.gz/refs/heads/quarkus","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hakdogan%2Fhibernate-search/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":272236580,"owners_count":24897452,"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","status":"online","status_checked_at":"2025-08-26T02:00:07.904Z","response_time":60,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":[],"created_at":"2024-11-05T14:13:09.081Z","updated_at":"2025-08-26T16:21:18.605Z","avatar_url":"https://github.com/hakdogan.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Hibernate Search\n[![Quality Gate Status](https://sonarcloud.io/api/project_badges/measure?project=org.jugistanbul%3Ahibernate-search\u0026metric=alert_status)](https://sonarcloud.io/dashboard?id=org.jugistanbul%3Ahibernate-search)\n[![Maintainability Rating](https://sonarcloud.io/api/project_badges/measure?project=org.jugistanbul%3Ahibernate-search\u0026metric=sqale_rating)](https://sonarcloud.io/dashboard?id=org.jugistanbul%3Ahibernate-search)\n[![Reliability Rating](https://sonarcloud.io/api/project_badges/measure?project=org.jugistanbul%3Ahibernate-search\u0026metric=reliability_rating)](https://sonarcloud.io/dashboard?id=org.jugistanbul%3Ahibernate-search)\n[![Coverage](https://sonarcloud.io/api/project_badges/measure?project=org.jugistanbul%3Ahibernate-search\u0026metric=coverage)](https://sonarcloud.io/dashboard?id=org.jugistanbul%3Ahibernate-search)\n\nHibernate Search is a library that allows keeping your local `Apache Lucene` indexes or `ElasticSearch` cluster in sync with your data that extracts from `Hibernate ORM` based on your domain model. This repository was created for an article published in the `Java Advent Calendar` and shows you how to use Hibernate Search in a concrete example.\n\n## Prerequisites\n\n* JDK 1.8 or later\n* Maven 3.x.x\n* Docker for Elasticsearch and PostgreSQL\n\n## Preparing the infrastructure\n\nThe entities of the application are stored in `PostgreSQL` and indexed in `ElasticSearch` so we need instances of them.\n\n```shell script\ndocker run --rm --name postgresql \\\n  -e POSTGRES_USER=postgres \\ \n  -e POSTGRES_PASSWORD=postgres \\ \n  -e POSTGRES_DB=jugistanbul \\ \n  -p 5432:5432 \\ \n  postgres:${POSTGRESQL_VERSION}\n```\n```shell script\ndocker run --rm --name elasticsearch  \\\n  -e \"discovery.type=single-node\" \\\n  -p 9200:9200 \\ \n  docker.elastic.co/elasticsearch/elasticsearch-oss:${ELASTICSEARCH_VERSION}\n```\n\n## Usage examples\n\n```json\nhttp -v GET localhost:8080/search/event/quarkus\nGET /search/event/Quarkus HTTP/1.1\nAccept: */*\nAccept-Encoding: gzip, deflate\nConnection: keep-alive\nHost: localhost:8080\nUser-Agent: HTTPie/2.3.0\n\n\n\nHTTP/1.1 200 OK\nContent-Length: 43\nContent-Type: application/json\n\n[\n  {\n    \"id\": 3,\n    \"name\": \"Introduction to Quarkus\"\n  }\n]\n\nhttp -v GET localhost:8080/search/host/title/consultion\nGET /search/host/title/consultion HTTP/1.1\nAccept: */*\nAccept-Encoding: gzip, deflate\nConnection: keep-alive\nHost: localhost:8080\nUser-Agent: HTTPie/2.3.0\n\n\n\nHTTP/1.1 200 OK\nContent-Length: 187\nContent-Type: application/json\n\n[\n  {\n    \"events\": [\n                {\n                  \"id\": 2,\n                  \"name\": \"CI \u0026 CD with Azure Devops\"\n                },\n                {\n                  \"id\": 3,\n                  \"name\": \"Introduction to Quarkus\"\n                }\n              ],\n              \"id\": 2,\n              \"firstname\": \"Huseyin\",\n              \"lastname\": \"Akdogan\",\n              \"title\": \"Expert Software Consultant\"\n  }\n]\n\nhttp -v GET localhost:8080/search/event/quar\nGET /search/event/Quar HTTP/1.1\nAccept: */*\nAccept-Encoding: gzip, deflate\nConnection: keep-alive\nHost: localhost:8080\nUser-Agent: HTTPie/2.3.0\n\n\n\nHTTP/1.1 404 Not Found\nContent-Length: 91\nContent-Type: application/json\n\n{\n    \"code\": 404,\n    \"error\": \"No event found\",\n    \"exceptionType\": \"javax.ws.rs.WebApplicationException\"\n}\n\n```\n\n## To run\n\n```shell script\nmvn quarkus:dev\n```\n\n## To tests\n\n```shell script\nmvn verify\n```\n\n## Relevant article\n[How to Keep Elasticsearch in Sync with Relational Databases?\n](https://hakdogan.medium.com/how-to-keep-elasticsearch-in-sync-with-relational-databases-a8c4c2b4c9fe)","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhakdogan%2Fhibernate-search","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhakdogan%2Fhibernate-search","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhakdogan%2Fhibernate-search/lists"}