Elasticsearch Sync with Hibernate Transaction

638 Views Asked by At

I have an application running on spring2.5, hibernate 3.1 and compass search engine.The compass search engine is synchronized with all db operations. So that I can get the data from compass cache quickly. Now I would like to replace compass with Elastic search engine .I'm newer to elastic search and I think the author of compass was developed the elastic search. So that the synchronization mechanism should implemented in elastic search also. Anyone please suggest a way how to do this.

2

There are 2 best solutions below

3
On

I don't know compass but Elasticsearch is search server on top of Lucene. And the only thing it does is update the search index based on a database query. This can be triggered manually or based on a timestamp filed in the database.

https://github.com/jprante/elasticsearch-jdbc

0
On

Hibernate Search provides a similar integration as Compass Search used to do.

Older versions of Hibernate Search would only provide Lucene embedded, but the latest is giving the option of using Elasticsearch instead.

This is in pretty good shape already, but highly contributed too so it's a great time to try it out and let us know what you feel is missing.

The catch is that it requires to use Hibernate ORM at version 5.0.0 at least: please upgrade Hibernate (you will benefit from that in many other ways too, not least much higher performance).