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 a second candidate release for Hibernate Search 6.0: version 6.0.0.CR2.

This release mainly brings a workaround for applications hanging on startup with Spring Boot 2.3+, type parameters for type bridges and property bridges, and an alternative, URI-based configuration for target Elasticsearch hosts.

It also includes an upgrade to Lucene 8.7.0, Elasticsearch 7.10.0 and Hibernate ORM 5.4.24.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.

If you want to migrate an application based on Hibernate Search 5, be aware that Hibernate Search 6 APIs differ significantly from Hibernate Search 5. We recommend you have a look at see the migration guide.

Reporting bugs

While this version has been tested extensively, and we don’t anticipate any particular problem, the goal of this candidate release is to catch as many bugs as possible before the final release.

If you happen to encounter problems, please contact us:

  • When you’re unsure whether it’s a usage issue or a bug, ask questions on Stack Overflow with the hibernate-search tag or on our forums in the "Hibernate Search" category.

  • When you’re clearly facing a bug, report it on JIRA.

  • For more communication channels, see here.

What’s new compared to Hibernate Search 5

For an overview of new features and improvements in Hibernate Search 6, see here.

What’s new compared to Hibernate Search 6.0.0.CR1

Workaround for Spring’s hang-on-startup bug

A bug in Spring may cause your application to hang on bootstrap if it relies on custom beans, unless you add specific configuration. This affects Spring Boot 2.3.0 and above.

As of HSEARCH-4096, Hibernate Search will only look for Spring beans when it cannot resolve a bean reference to a built-in bean. This means that an application that does not rely on custom beans will not be affected by Spring’s hang-on-startup bug.

Additionally, bean references in configuration properties can now use a prefix in order to specify how the bean is to be retrieved. A bean reference such as constructor:com.mycompany.MyBean, for example, will always bypass Spring and use reflection to instantiate the bean, thereby avoiding Spring’s hang-on-startup bug. The bean won’t be able to rely on @Autowired or other Spring features, however.

If you really need to use Spring beans in Hibernate Search components, until the Spring project resolves this deadlock, the best workaround is to set the property spring.data.jpa.repositories.bootstrap-mode to deferred in your application.properties/application.yaml.

Type parameters for TypeBridge/PropertyBridge

As of HSEARCH-4088, TypeBridge is now TypeBridge<T> and PropertyBridge is now PropertyBridge<P>. The new type parameter represents the expected type of bridged elements. It allows for easier detection of incorrectly applied bridges.

See the updated documentation for more information.

Existing bridges implementing the raw TypeBridge/PropertyBridge types will continue to work without any change.

Configuring URIs instead of hosts

As of HSEARCH-4099, the target Elasticsearch cluster can alternatively be configured using URIs, for example:

hibernate.search.backend.uris = https://es1.mycompany.com:9200,https://es2.mycompany.com:9200

The host-based configuration can still be used, but not at the same time as URI-based configuration:

hibernate.search.backend.hosts = es1.mycompany.com:9200,es2.mycompany.com:9200
hibernate.search.backend.protocol = https

Version upgrades

Hibernate Search 6 requires ORM 5.4.4.Final or later to work correctly. Earlier 5.4.x versions will lead to potentially cryptic runtime exceptions.

Breaking changes

  • HSEARCH-4096: Bean references in configuration properties (e.g. for an analysis configurer) are now parsed. Attempting to reference a bean whose name contains a colon (e.g. my.company:analysis:configurer) will lead to an exception on bootstrap. To work around that, prefix the bean name with the bean resolution mode, for example bean:my.company:analysis:configurer. See here for more information.

  • HSEARCH-4100: Queries and requests are now logged at the TRACE level.

  • HSEARCH-4101: The default required status for Elasticsearch indexes is now yellow.


  • HSEARCH-4067: Configuration examples no longer include confusing comments (such as (default)).

  • HSEARCH-4074: It should be clearer which type of bridge to chose, depending on the use case.

  • HSEARCH-4094: The documentation of the JSR-352 integration now clearly mentions that an additional dependency is necessary.

  • HSEARCH-4113: Documented a limitation regarding the serialization of an ORM Session.

Other improvements and bug fixes

  • HSEARCH-4102: When using Elasticsearch, the no-alias layout strategy can now be selected in order to avoid index aliases altogether. This is mainly useful on legacy applications.

  • HSEARCH-4069: SearchResult.took() is now more accurate with the Lucene backend.

  • HSEARCH-4107: With Spring Boot 2.4+, the methods Search.getFullTextEntityManager(…​)/Search.getFullTextSession(…​) of the Search 5 migration helper will no longer throw a ClassCastException.

  • HSEARCH-4108: The SearchSession returned by Search.session(…​) can now be used from multiple threads if the EntityManager/Session is thread-safe. Typically, that’s the case for an EntityManager/Session injected by CDI or Spring into a transactional bean.

  • HSEARCH-4112: Hibernate Search will no longer fail to index entities when using Spring with JTA enabled.

  • HSEARCH-4116: Empty, blank or null configuration properties will now be ignored when detecting unused properties.

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