Hibernate Search {hibernateSearchVersion}: Migration Guide from {hibernateSearchPreviousStableVersionShort}
The aim of this guide is to assist you migrating
an existing application using any version {hibernateSearchPreviousStableVersionShort}.x
of Hibernate Search
to the latest of the {hibernateSearchVersionShort}.x
series.
Note
|
If you think something is missing or something does not work, please contact us. |
If you’re looking to migrate from an earlier version, you should migrate step-by-step, from one minor version to the next, following the migration guide of each version.
Warning
|
To Hibernate Search 5 users Be aware that a lot of APIs have changed since Hibernate Search 5, some only because of a package change, others because of more fundamental changes (like moving away from using Lucene types in Hibernate Search APIs). When migrating from Hibernate Search 5, you are encouraged to migrate first to Hibernate Search 6.0 using the 6.0 migration guide, and only then to later versions (which will be significantly easier). |
The requirements of Hibernate Search {hibernateSearchVersion} are the same as those of Hibernate Search {hibernateSearchPreviousStableVersionShort}:
-
JDK 11 or later;
-
Lucene 9 for its Lucene backend;
-
Elasticsearch 7.10+ or OpenSearch 1.3+ for its Elasticsearch backend;
-
Hibernate ORM 6.4.x for the Hibernate ORM integration.
The coordinates of Maven artifacts in Hibernate Search {hibernateSearchVersion} are the same as in Hibernate Search {hibernateSearchPreviousStableVersionShort}.
The index format and schema in Hibernate Search {hibernateSearchVersion} is backward-compatible with Hibernate Search {hibernateSearchPreviousStableVersionShort}: older indexes can be read from and written to without reindexing.
The event and agent database tables used for outbox-polling in Hibernate Search {hibernateSearchVersion} are backward-compatible with Hibernate Search {hibernateSearchPreviousStableVersionShort}: no database schema update is necessary for these tables.
The configuration properties in Hibernate Search {hibernateSearchVersion} are backward-compatible with Hibernate Search {hibernateSearchPreviousStableVersionShort}.
The API in Hibernate Search {hibernateSearchVersion} is backward-compatible with Hibernate Search {hibernateSearchPreviousStableVersionShort}.
With Hibernate ORM allowing non-String
tenant identifiers, some of the Hibernate Search methods got deprecated and alternatives were introduced:
-
org.hibernate.search.mapper.orm.scope.SearchScope#workspace(String tenantId)
deprecated in favor oforg.hibernate.search.mapper.orm.scope.SearchScope#workspace(Object tenantId)
-
org.hibernate.search.mapper.orm.scope.SearchScope#massIndexer(String tenantId)
deprecated in favor oforg.hibernate.search.mapper.orm.scope.SearchScope#massIndexer(Object tenantId)
-
org.hibernate.search.mapper.pojo.standalone.scope.SearchScope#workspace(String tenantId)
deprecated in favor oforg.hibernate.search.mapper.pojo.standalone.scope.SearchScope#workspace(Object tenantId)
-
org.hibernate.search.mapper.pojo.standalone.scope.SearchScope#massIndexer(String tenantId)
deprecated in favor oforg.hibernate.search.mapper.pojo.standalone.scope.SearchScope#massIndexer(Object tenantId)
-
org.hibernate.search.mapper.pojo.standalone.session.SearchSession#tenantIdentifier()
deprecated in favor oforg.hibernate.search.mapper.pojo.standalone.session.SearchSession#tenantIdentifierValue()
-
org.hibernate.search.mapper.pojo.standalone.session.SearchSessionBuilder#tenantId(String tenantId)
deprecated in favor oforg.hibernate.search.mapper.pojo.standalone.session.SearchSessionBuilder#tenantId(Object tenantId)
-
org.hibernate.search.mapper.orm.outboxpolling.mapping.OutboxPollingSearchMapping#countAbortedEvents(String tenantId)
deprecated in favor oforg.hibernate.search.mapper.orm.outboxpolling.mapping.OutboxPollingSearchMapping#countAbortedEvents(Object tenantId)
-
org.hibernate.search.mapper.orm.outboxpolling.mapping.OutboxPollingSearchMapping#reprocessAbortedEvents(String tenantId)
deprecated in favor oforg.hibernate.search.mapper.orm.outboxpolling.mapping.OutboxPollingSearchMapping#reprocessAbortedEvents(Object tenantId)
-
org.hibernate.search.mapper.orm.outboxpolling.mapping.OutboxPollingSearchMapping#clearAllAbortedEvents(String tenantId)
deprecated in favor oforg.hibernate.search.mapper.orm.outboxpolling.mapping.OutboxPollingSearchMapping#clearAllAbortedEvents(Object tenantId)
The SPI in Hibernate Search {hibernateSearchVersion} is backward-compatible with Hibernate Search {hibernateSearchPreviousStableVersionShort}.
Deprecated methods removed:
-
org.hibernate.search.mapper.pojo.scope.spi.PojoScopeDelegate#workspace(DetachedBackendSessionContext)
-
org.hibernate.search.mapper.pojo.scope.spi.PojoScopeDelegate#massIndexer(PojoMassIndexingContext,DetachedBackendSessionContext)
The behavior of Hibernate Search {hibernateSearchVersion} is backward-compatible with Hibernate Search {hibernateSearchPreviousStableVersionShort}.
Note
|
It is worth mentioning that with the changes in HSEARCH-5062 you may notice changes in the queries Hibernate Search creates to load entities. While we are expecting that the introduced changes should help with performance, if you notice any problems with them, we’d appreciate you reaching out to let us know. |