Let me tell you my short experience with Hibernate and ES.
At first, I tried to work with Alois OSEM annotations and with Hibernate
listeners to push to ES every entity which is @Searchable.
But, listeners are not the right place to do it, as Hibernate Search does
it. Because, when you update a child entity (which is not annotated by
Searchable), you will not push the update to ES... (It's the short story).
So, as it's really easy to create JSON documents from Hibernate objects
using Jackson, I now manage directly my push requests to ES from the service
As I'm using Spring, I simply inject an ES Node in my Service Class and play
with it every time I need to create/update or delete a document in ES.
I tried to work on a maven plugin for ES based on OSEM annotations in order
to generate mapping files but I'm stucked with classloading problems, so I
can't release it
Let me say also, that I use now an ActiveMQ queue to make everything
So when I want to reindex all my postgresql database, I simply read all my
entities with Hibernate and push them to the ActiveMQ queue. The queue
listener takes the entity, build the JSON content (BTW, compute some datas,
create a PDF file, send some stuff to a couchDB database, ...) AND finally
push it to ES.
This process is running while the application is live for users.
If you have only to push your entities to ES, you can build a very simple
batch that fetch all your entities, build the JSON and push to ES. Depending
on your entities complexity (the read time in postgresql could be very
high), you can have nice bulk load times.
On a "single windows computer", I indexed 5 to 10 entities per second for
very complex entities (many collections, ...).
I indexed about more than 300 entities per second for simple entities. So
the main problem is really the YesSQL read time.
I'm not sure I answered to your questions and I hope you can understand my
De : firstname.lastname@example.org [mailto:email@example.com]
De la part de Stefan Fußenegger
Envoyé : mercredi 21 décembre 2011 13:35
À : elasticsearch
Objet : Planned project/Compass replacement
I am one of the poor guys who is stuck on Compass. Like most others,
I'm desperately waiting for a similar framework built on
elasticsearch. But now I've finally decided to stop waiting and start
Currently, I'm investigating existing projects, efforts and
approaches. What I'm mainly looking for is object to JSON mapping
(jackson, elasticsearch-osem), Hibernate integration and reusable
index rebuilding code. Current efforts seem to be driven by single
developers without much coordination (am I wrong?). It might therefore
be valuable to simply join forces towards a common goal.
Anyway, I'm the planning and design phase, so I'd be happy for input
of any sort (existing projects, features, requirements, ...),
additional contributors, testers, helpers or pure and simple interest
in the topic. I hope to come up with some ideas during the holidays -
using sources of inspiration like slopes, mountains and the obligatory
consumption of alcoholic beverages during family gatherings