Elastic search - integrate with java web application Elastic search - integrate with java web application elasticsearch elasticsearch

Elastic search - integrate with java web application


I don't think there is yet really any tutorial. I started writing one some days ago. When finished it will be published on elasticsearch.org website.

That said, I built a web application, ScrutMyDocs, with the idea that it could be an example of "how to integrate Elasticsearch in a Web App".Source code is available on Github so you can find some ideas from here.

Also, note that this project uses Spring as well and my Spring factories for Elasticsearch project. It could help you also.

About Hibernate, on a previous project, I started to add listeners on entities to automatically index or remove documents in Elasticsearch. But at the end, I removed all that stuff because I think it's not the right way to do that. Instead, I was calling Elasticsearch index and remove methods from my application Service Layer each time I was calling merge or delete DAO Hibernate methods.

Hope this helps


To build a Java web app which is using Hibernate ORM, the best solution to integrate Elasticsearch is to use Hibernate Search as it's designed specifically for this purpose.

The previously accepted answer was fine, but is now outdated (I'm writing this 4 years later).