Hibernate Search 5.1

Posted by    |       Hibernate Search

Hibernate Search is a library that integrates Hibernate ORM with Apache Lucene or Elasticsearch by automatically indexing entities, enabling advanced search functionality: full-text, geospatial, aggregations and more. For more information, see Hibernate Search on hibernate.org.

Now that feedback is coming about our great 5.0 release, it's time to publish quite a maintenance version as we have a long list of improvements already! So today we release Hibernate Search 5.1.0.Final.

Performance improvements

The indexing engine learned yet another smart trick, and is going to generate more efficient delete and update operations in case you have a non-trivial hierarchy of entities being mapped. See also HSEARCH-1767 for more details. This might not affect you at all, or it might give you a very significant performance boost!

Also affecting performance, the caching code for Filters improved and this might result in a higher cache hit ratio.

Many usability improvements

  • It is no longer required to provide a key object for parameterized Filters (we'll figure it out automatically). (HSEARCH-295)
  • You can now use annotations to declare Filters and Analyzers on packages or super classes! After all, these are global. (HSEARCH-1763, HSEARCH-633)
  • When booting programmatically, you can now inject an instance of an ErrorHandler (HSEARCH-1624)
  • The programmatic configuration API was improved by adding some missing methods

Projection: bugfixes

There was a bug in projecting values of embeddable types which could strike occasionally, as it would trigger only on some specific iterations of the metadata, which is unsorted so it could manifest only occasionally. This is fixed now as HSEARCH-1786.

Many thanks to Rustem Sagimbekov, Marc Schipperheyn and Ildar Mussin for reporting it and helping me diagnose the problem.


Some users have recently been trying to use Hibernate Search combined with Hibernate ORM's multi-tenancy features. We have to admit this wasn't tested! We added a warning in the documentation, as some more work is going to be needed to make for a flawless integration experience.

There was one blocker preventing people to use the MassIndexer HSEARCH-1649 with multi-tenancy, which is fixed now. So while there are still some limitations documented here, you should be able to move forward. Please let us know if more changes are needed (on top of the known limitations, which are easy to work around for now).

OSGi improvements

With 5.0 we published our first experimental support for depoying in OSGi, and it's maturing quickly thanks to all your feedback! Thanks to Gustavo Nalle and Andy Phillips for the latest suggestions and improvements.


The optional serialization module based on plain standard Java serialization was removed. Please use hibernate-search-serialization-avro, which has always been the better implementation. If you had strong reasons to love the plain java implementation, let us know.

Components upgrades

  • Apache Lucene released 4.10.4
  • Infinispan upgraded to 7.1.1

Get it now!

Everything you need is available on Hibernate Search's web site. Download the full distribution from here. And don't hesitate to reach us in our forums.


If you prefer to use stackoverflow.com, please use the tag hibernate-search. And if you have a moment to help other users, some please consider registering to the hibernate-search tag to help us answering all the questions.

If you are new to Hibernate Search, best is to start with our getting started guide. And remember: feedback, comments and/or pull-requests are welcome on the website too.

Back to top