Hibernate Search 6.0.0.Alpha9 released

Posted by    |      

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.

We just published Hibernate Search 6.0.0.Alpha9, a new release of the still-in-development 6.0 branch. This release mainly introduces correct handling of session flushing and clearing, restores support for static sharding and upgrades to Elasticsearch 7.3, Lucene 8.2 and Hibernate ORM 5.4.4.Final.

Getting started with Hibernate Search 6

If you want to dive right into the new, shiny Hibernate Search 6, a good starting point is the getting started guide included in the reference documentation.

Hibernate Search 6 is still in development and its APIs differ significantly from Search 5.

For more information about the current status of this branch, see the page dedicated to Search 6 on hibernate.org.

For more information about migration and what we intend to do to help you, see the migration guide.

What’s new

Correct handling of session flushing and clearing

As of HSEARCH-3360, multiple long-standing problems (HSEARCH-1270, HSEARCH-1350, …​) related to clearing the Hibernate ORM session have been solved.

It is now possible to transparently implement batch processing with a periodic flush/clear:

  • calls to Hibernate Search APIs such as fullTextSession.flushToIndexes() are no longer necessary;

  • entities removed from the session in the clear will no longer lead to a LazyInitializationException;

  • every document created in a transaction containing a loop with a periodic flush/clear will correctly be indexed on transaction commit (and not in the middle of the transaction).

Note that Hibernate Search still needs to store the documents in memory until they are indexed on transaction commit, which may be more than what your JVM heap can handle, depending on the number and complexity of your documents. Several solutions to this problems are included in the section of the documentation about explicit indexing.

Static sharding

Support for static sharding has been restored as of HSEARCH-3314. It is now possible to leverage routing keys with Elasticsearch, and to split a Lucene index into several (statically defined) shards.

See the section of the documentation about sharding for more information.

Backward-incompatible API changes

As of HSEARCH-3642, the DslConverter and ProjectionConverter enums used in the search DSL have been replaced with a single enum, ValueConvert.

Version upgrades

Hibernate Search 6 now requires ORM 5.4.4.Final or later to work correctly. Earlier 5.4.x versions will not work correctly.

This is caused by a change (HSEARCH-3447) that was necessary to avoid the deprecated native criteria APIs that may be removed in ORM 6 .

Other improvements and bug fixes

  • HSEARCH-3612: Patterns are now consistently normalized in wildcard/prefix predicates.

  • HSEARCH-3062: It is now possible to project on single-valued fields within nested object fields.

  • HSEARCH-3551: Hibernate Search will now boot correctly when declared as a dependency in a module-info.java.

  • HSEARCH-3068: Hibernate Search 6 will now correctly trigger indexing on flush when performing entity changes outside of a transaction (not recommended).

  • HSEARCH-3643: Entities will now be unproxied before attempting to extract field values when indexing. Thanks to Alexis Cucumel for bringing this bug to our attention.

  • HSEARCH-899: Uses of @IndexedEmbedded on types that are not mapped in any way (no @GenericField, no custom bridge, …​) will now trigger a bootstrap failure.

And more. For a full list of changes since the previous releases, please see the release notes.

How to get this release

All details are available and up to date on the dedicated page on hibernate.org.

Feedback, issues, ideas?

To get in touch, use the following channels:


Back to top