We just published the first candidate release for Hibernate Search 6.0: version 6.0.0.CR1.
Compared to Hibernate Search 5, changes are extensive, due to the API overhaul, but with plenty of improvements: upgrades to Lucene 8 and Elasticsearch 7 of course, but also a more concise Search DSL with typed result types, full control on field declaration in Bridges, easier to configure and more efficient automatic indexing, runtime joins with nested documents, …
No more changes are planned before the final release, so this is the perfect time to test your applications based on Hibernate Search, and report problems as soon as possible so that everything works perfectly as soon as 6.0.0.Final is released.
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.
Attention Spring users
Be aware that a bug in Spring may cause your application to hang on bootstrap, unless you add specific configuration. This affects Spring Boot 2.3.5.RELEASE and probably earlier 2.3.x versions as well. Until the Spring project resolves this deadlock, the best workaround is to set the property
We are also trying to implement a workaround within Hibernate Search, at least for applications that do not use custom beans in Hibernate Search. To track progress on this issue, see HSEARCH-4096. |
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.Beta11
Compared to the last beta, this version includes the batch for Java (JSR-352) integration to the ORM mapper, and an upgrade to Hibernate ORM 5.4.23.Final.
Batch for Java (JSR-352) mass indexing job
As of HSEARCH-3269, Hibernate Search 6 once again includes a JSR-352 mass indexing job, through a dedicated module.
See this section of the documentation for more information.
Built-in analyzer definitions for Lucene
As of HSEARCH-2584, the Lucene backend now provides a few built-in analyzer definitions, for convenience.
See this section of the documentation for more information.
Scrolls now provide a total hit count
As of HSEARCH-4023,
SearchScrollResult
now provides a total hit count:
try ( SearchScroll<Book> scroll = searchSession.search( Book.class )
.where( f -> f.matchAll() )
.scroll( 20 ) ) {
for ( SearchScrollResult<Book> chunk = scroll.next();
chunk.hasHits(); chunk = scroll.next() ) {
for ( Book hit : chunk.hits() ) {
// ... do something with the hits ...
}
long totalHitCount = chunk.total().hitCount();
entityManager.flush();
entityManager.clear();
}
}
Configurable path prefix for the Elasticsearch backend
As of HSEARCH-4051,
for non-standard setups where the REST API endpoint is not the root (/
),
a path prefix can now be configured.
See this section of the documentation for more information.
Version upgrades
-
HSEARCH-4040: Upgrade to Elasticsearch 7.9.2.
-
HSEARCH-4087: Upgrade to Hibernate ORM 5.4.23.Final.
-
HSEARCH-4085: Upgrade to Hibernate Commons Annotations 5.1.2.Final.
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-4041: Deprecated classes, interfaces and methods that were introduced during the Alphas/Betas of Hibernate Search 6 were removed. This includes in particular:
-
RoutingKeyBridge
⇒ UseRoutingBridge
instead. -
API methods starting with
get
/set
/is
⇒ Use the corresponding method without theget
/set
/is
prefix instead. -
ObjectFieldStorage
⇒ UseObjectStructure
instead. -
SearchResult#totalHitCount()
⇒ Use.total().hitCount()
instead. -
org.hibernate.search.mapper.orm.mapping.SearchIndexedEntity
⇒ Useorg.hibernate.search.mapper.orm.entity.SearchIndexedEntity
instead. -
BuiltinContainerExtractors.ARRAY
⇒ UseBuiltinContainerExtractors.ARRAY_OBJECT
instead. -
@IndexedEmbedded(maxDepth = …)
⇒ Use@IndexedEmbedded(includeDepth = …)
instead. -
@IndexedEmbedded(storage = …)
⇒ Use@IndexedEmbedded(structure = …)
instead. -
Search DSL:
-
asEntity()
/asEntityReference()
/asProjection(…)
/asProjections(…)
⇒ UseselectEntity()
/selectEntityReference()
/select(…)
instead. -
.predicate( f → …)
⇒ Use.where( f → … )
instead.
-
-
-
HSEARCH-4071: Deprecated configuration properties that were introduced during the Alphas/Betas of Hibernate Search 6 were removed. This includes:
-
hibernate.search.default_backend
⇒ No equivalent. Configure the default backend with the prefixhibernate.search.backend.
, or named backends with the prefixhibernate.search.backends.<backend name>.
. -
Prefix
hibernate.search.backend.index_defaults.
⇒ Configure index defaults directly at the backend level instead, usinghibernate.search.backend.
. -
Prefix
hibernate.search.backends.<backend name>.index_defaults.
⇒ Configure index defaults directly at the backend level instead, using the prefixhibernate.search.backends.<backend name>.
.
-
-
HSEARCH-3402: Async/reactive methods now return
CompletionStage
instead ofCompletableFuture
. To convert aCompletionStage
to aFuture
, call.toCompletableFuture()
.
Documentation
-
HSEARCH-3283: An extensive guide is now available for migrating from Hibernate Search 5 to Hibernate Search 6: see here.
-
HSEARCH-4055: Base POJO-related API such as mapping annotations (
@Indexed
,@GenericField
) are now included in the javadoc. -
HSEARCH-4064: The reference documentation now includes a "Limitations" section.
-
HSEARCH-4076: The reference documentation now includes a "Troubleshooting" section.
Other improvements and bug fixes
-
HSEARCH-3308, HSEARCH-3356, HSEARCH-3996, HSEARCH-4006, HSEARCH-4047: Log messages and exception messages are now clearer and more consistent.
-
HSEARCH-3402: Async/reactive methods now return
CompletionStage
instead ofCompletableFuture
. -
HSEARCH-3905: The
exists
predicate now correctly takes into account dynamic fields when targeting an object field with the Lucene backend. -
HSEARCH-4000:
@IndexingDependency
,@AssociationInverseSide
are now repeatable. -
HSEARCH-3990, HSEARCH-4068: Various optimizations for Lucene search queries.
-
HSEARCH-4046: Expose a map of static children by name in the metamodel of object fields.
-
HSEARCH-4048: Precedence of field templates now works correctly, even between an object field template and a value field template.
-
HSEARCH-4056:
LuceneIndexManager
now allows computing the index size (in bytes). -
HSEARCH-4070: Lucene scrolls no longer ignore
totalHitCountThreshold
. -
HSEARCH-4079: Search query no longer systematically time out when the timeout is lower than 1ms.
-
HSEARCH-4080: The total hit count is now correctly considered as a lower bound when Lucene search queries time out.
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:
-
hibernate-search tag on Stackoverflow (usage questions)
-
User forum (usage questions, general feedback)
-
Issue tracker (bug reports, feature requests)
-
Mailing list (development-related discussions)