|Java||8, 11 or 15|
|Hibernate ORM||5.4 (>= 5.4.4.Final)|
|Elasticsearch||5.6 - 7.10|
Not compatible with your requirements? Have a look at the other series.
See also the Compatibility policy.
Documentation for this specific series can be accessed through the links below:
You can find more documentation for all series on the documentation page.
How to get it
More information about specific releases (announcements, download links) can be found here.
If you want to start using the library, please refer to the getting started guide:
If you need to upgrade from a previous series, please refer to the migration guide:
Latest release announcement (2020-11-23): 6.0.0.CR2.
A detailed list of new features, improvements and fixes in this series can be found on our JIRA instance.
Hibernate Search 6 relies on Hibernate ORM 5.4.
Note that only Hibernate ORM 5.4.4.Final or later will work correctly; 5.4.3.Final and earlier will not.
A lot of APIs have been changed, for multiple reasons.
The API types consistently use the
Search prefix: no more mixing
Search or simply no prefix.
SearchQuery type (previously
now defines its own methods
instead of extending JPA’s
highlighting the fact that it targets an index and not a database, and making it a friendlier API.
It is still possible to
create an adapter that implements JPA’s
Hibernate Search APIs now abstract from the Lucene APIs, so that alternative backends such as Elasticsearch can be used without having Lucene on your classpath.
This should also improve the ability of the Hibernate Search project to upgrade Lucene as soon as new versions are released. In Hibernate Search 5, as Lucene was "part of" Hibernate Search APIs, we were severely limited when we wanted to upgrade to a newer Lucene version, because any breaking change in Lucene could mean a breaking change for Hibernate Search users, too. Now that Lucene APIs are no longer necessary to use Hibernate Search, upgrades should be faster.
The Search DSL is brand new, with several improvements:
Type-safe projections thanks to the brand-new projection DSL.
Injection of native predicates (
org.apache.lucene.search.Queryfor Lucene, JSON for Elasticsearch) within DSL-created predicates. This is not new for the Lucene integration, but it is for the Elasticsearch integration. See predicate extensions.
Simpler syntax for predicates when targeting multiple types in a single query: instantiating multiple
QueryBuildersis no longer needed, Hibernate Search takes into account that multiple types are targeted and automatically checks that targeted fields are compatible across all targeted indexes.
The bridge APIs had to change as part of the API refresh, so we took this opportunity to overhaul bridge APIs to make bridges more powerful.
The new Bridge APIs are completely different, but with a lot of improvements:
bridges targeting non-String fields are now first-class citizens: when targeting bridge-declared, non-String fields in the Search DSL, you will no longer have to bypass bridges (
.ignoreFieldBridge()) like you had to in Search 5;
bridges can define field types precisely, allowing in particular to pick an analyzer or to enable aggregation (faceting) on a bridge-declared field;
bridges can declare the properties they rely on, allowing Hibernate Search to reindex less frequently;
bridges can declare dynamic fields with a precise type which the Search DSL will be aware of;
bridges can be applied with custom annotations, allowing clearer mappings, especially when bridges are parameterized;
In Hibernate Search 6, automatic indexing is easier to configure correctly:
@ContainedInis no longer needed: when using
@IndexedEmbeddedon an association, Hibernate Search 6 infers the inverse side of the association from Hibernate ORM metadata, which allows it to automatically reindex the class hosting the
@IndexedEmbeddedannotation when the target of the association changes.
When the inverse side of an association cannot be resolved, Hibernate Search 6 will report a mapping error on bootstrap, allowing you to detect risks of out-of-sync indexes early.
You can still opt out of automatic reindexing locally using
@IndexingDependency(reindexOnUpdate = ReindexOnUpdate.NO).
Some want more performance with asynchronous automatic indexing, others prefer data safety and immediate visibility of indexed documents with synchronous automatic indexing. With Hibernate Search 6, this can all be configured with a single configuration property.
Hibernate Search 6 is also more efficient when processing changes on complex entity graphs.
When a property changes in an entity that is indexed-embedded in multiple other entities,
Hibernate Search 6 will only traverse associations to entities that are actually
affected by the change, based on
@IndexedEmbedded(includePaths = …) and other metadata.
This means in particular that indexed-embedded entities can be searched much more finely, for example searching for that one book whose author has a given first name and last name. With the right query, no longer will Hibernate Search return a book authored by "John Smith" and "Jane Doe" when you were looking for "John Doe"!
For details, see
@IndexedEmbedded storage type
in the reference documentation.
Creating Elasticsearch indexes with the right mapping can be a complex task. Doing it at the right time in a distributed application, even more so.
Just like Hibernate Search 5, Hibernate Search 6 can manage the schema for you on startup, but you can also disable automatic schema management and access dedicated APIs to trigger schema operations on demand.
Releases in this series
Workaround for applications hanging on startup with Spring Boot 2.3+, type parameters for type bridges and property bridges, URI-based configuration for target Elasticsearch hosts, upgrade to Hibernate ORM 5.4.24.Final, Lucene 8.7, Elasticsearch 7.10.
First release candidate for Hibernate Search 6. Compared to Beta11: Batch for Java (JSR-352) integration for the ORM mapper, built-in analyzer definitions for Lucene, total hit count on scrolls, optional path prefix for Elasticsearch, upgrade to Hibernate ORM 5.4.23.Final.
Default analyzer, ReindexOnUpdate.SHALLOW to limit automatic reindexing to same-entity updates only, new implementation for AWS IAM authentication, migration helper for applications moving from Search 5 to Search 6, upgrades to Lucene 8.6.2 and Hibernate ORM 5.4.22.Final
Total hit count threshold, conditional indexing, per-index analyzer definitions for Elasticsearch, better timeouts, upgrades to Lucene 8.6.1, Elasticsearch 7.9.0 and Hibernate ORM 5.4.21.Final
Simpler configuration, scrolling, projections on multi-valued fields, complete documentation, upgrades to Lucene 8.6.0, Elasticsearch 7.8.0 and Hibernate ORM 5.4.19.Final
Entity graphs in search queries, @Indexed becomes inherited, upgrades to Lucene 8.5.2, Elasticsearch 7.7.0 and Hibernate ORM 5.4.17.Final
Better sorts/aggregations on multi-valued/nested fields, dynamic index fields, index metamodel, low-level configuration of the Lucene backend, upgrade to Hibernate ORM 5.4.15.Final
Bugfixes, schema management configuration and API at the mapper level, sorts on multi-valued fields, simpler and configurable indexing queues, implicit nested predicates, offline startup for Elasticsearch, upgrades to Lucene 8.5, Elasticsearch 7.6.1 and Hibernate ORM 5.4.13.Final
Aliases for Elasticsearch indexes, delayed commits and NRT for Lucene, renaming of a few Search DSL methods, upgrades to Lucene 8.4, Elasticsearch 7.6 and Hibernate ORM 5.4.12.Final.
Fixed a performance regression in the Lucene backend, new MassIndexingFailureHandler for custom behavior on failure during mass indexing.
Schema improvements, deep customization of Elasticsearch search requests, more powerful bridge definitions, search query timeouts, upgrades to Lucene 8.3.0, Elasticsearch 7.5 and Hibernate ORM 5.4.10.Final.
Search analyzers, improved background failure handling, upgrades to Elasticsearch 7.4 and Hibernate ORM 5.4.7.Final.
Consistent API expected to remain stable, complete documentation for major features, aggregations.
Correct handling of session flushing and clearing, static sharding, upgrades to Elasticsearch 7.3, Lucene 8.2 and Hibernate ORM 5.4.4.Final
Restored configuration options for entity loading and Lucene index storage, simpler and more powerful bridge APIs, upgrades to Elasticsearch 7.2 and Lucene 8.1
Missing index field type parameters restored, explicit indexing APIs restored, upgrade to Elasticsearch 6.8 and 7.1.
Decent performance for Lucene index access, indexing BigDecimal and BigInteger, less verbose search DSL, configuration of on-commit synchronization for automatic indexing, other bugfixes and improvements.
"indexNullAs" feature restored, API to declare dependencies in bridges, Elasticsearch 6.7 and 7.0, other bugfixes and improvements.
"exists" predicate, DSL converter bypass and analyzer override in predicates, upgrade to Lucene 8, Elasticsearch AWS integration restored, other bugfixes and improvements.
More field types, more predicates, more consistent and less verbose API, other bugfixes and improvements.
Mass indexer, Elasticsearch index lifecycle, efficient work orchestration in Elasticsearch, more projections, shorter annotation names, settings improvements.
Initial implementation: a few field types only, a few predicates/sorts/projections only, sub-optimal work orchestration, minimal documentation.