We just published Hibernate Search 6.0.0.Beta11.
This release mainly brings a default analyzer, a way to limit automatic reindexing to same-entity updates only, a new implementation for AWS IAM authentication, and a migration helper for applications moving from Search 5 to Search 6.
It also includes an upgrade to Lucene 8.6.2, and Hibernate ORM 5.4.22.Final.
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 APIs differ significantly from Hibernate Search 5.
For more information about migration and what we intend to do to help you, see the migration guide.
Both the Lucene backend and the Elasticsearch backend now have a default analyzer definition, which can be used even if you didn’t configure analysis.
Thanks to this new default analyzer, the
analyzer attribute in
@FullTextField(analyzer = …) no longer needs to be set:
for simple use cases, you can just use
@FullTextField without any argument,
which will create an index field using the default analyzer.
This should make experimenting with Hibernate Search easier, even if it’s unlikely that a single default analyzer will be enough for real-world applications.
As of HSEARCH-4001,
it is now possible to apply
@IndexingDependency(reindexOnUpdate = ReindexOnUpdate.SHALLOW) to an association.
If that association also has an
@Indexedentity is indexed, the entities targeted by the association will be index-embedded as usual (no change here).
When the association changes (associated entities are added or removed), then the
@Indexedentity will be automatically reindexed as usual (no change here.)
When the associated entities are modified (e.g. their
nameproperty change), the
@Indexedentity will not be automatically reindexed.
This is especially useful for associations to "reference" entities (e.g. categories, types, cities, countries, …) which are not expected to change and cannot possibly expose the inverse side of the association (e.g. city ⇒ address), which would be necessary for automatic reindexing.
For more information, head to this section of the documentation.
org.hibernate.search:hibernate-search-backend-elasticsearch-aws provides AWS IAM authentication,
so that applications can use AWS Elasticsearch Service as a backend,
which is an alternative to an on-premises cluster or Elastic’s own cloud offering.
This module was re-implemented to rely on the AWS SDK instead of a third-party library. This fixed a known bug of request signing (HSEARCH-3655), and opened the way to other ways of providing credentials.
|As a result of re-implementing this module, configuration properties related to AWS authentication have changed. See Breaking changes for more details.|
As of HSEARCH-3282, we publish two modules that provide partial compatibility with Hibernate Search 5 APIs backed by the Hibernate Search 6 implementations.
These modules should make migration easier by making sure that code relying on the most-used APIs (search DSL, …) continues to compile and run. The idea is to use the migration helper temporarily to make most of the application code (search queries, …) work, making it easier to focus on migrating configuration and to assess the effort required to migrate the remaining code.
|These modules should not be used in production environments. They have limitations preventing full compatibility with Hibernate Search 5, and these limitations will never be addressed. All code in these modules is deprecated and will be removed in the next major version.|
More information will come in the following weeks about how to use these modules when migrating, and what their limitations are. In particular, expect some updates to the migration guide soon.
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.
HSEARCH-3560: the properties to configure AWS authentication have changed:
In order to specify credentials statically in configuration properties, you must set
staticand also set the following two properties.
org.hibernate.search.mapper.orm.mapping.SearchIndexedEntityis now deprecated and will be removed before the release of Hibernate Search 6.0.0.CR1. Use
The incubating interface
org.hibernate.search.mapper.pojo.extractor.ContainerExtractorchanged; see its javadoc for defails of the new interface.
arraycontainer extractor was renamed to
array-object. Variants were introduced for arrays of each primitive type (
array-byte, …). See
org.hibernate.search.mapper.pojo.extractor.builtin.BuiltinContainerExtractorsfor a list of all available container extractors.
HSEARCH-3071: Support for
@IndexedEmbedded.includeEmbeddedObjectIdhas been restored.
MappingAnnotatedProperty(used in annotation processors) now exposes the type of the property for any given
HSEARCH-4003: Repeatable annotations are now automatically expended when retrieved from
MappingAnnotatedElement(used in annotation processors).
SearchScopenow exposes metadata about the targeted types through
HSEARCH-3243: Hibernate Search will now reject identifier/value bridges whose compatibility with the bound property cannot be validated. As a rule of thumb, when implementing identifier/value bridges, the generic type parameter
Tshould always be set to a raw class. For more advanced implementations, you should rely on an
java.lang.Errorthrown during mass indexing is no longer swallowed and are propagated to the caller.
HSEARCH-3997: Mapping arrays of primitive types (int/float/etc.) now works as expected: it no longer leads to a
HSEARCH-3998: Mass indexing a (non-abstract) parent class in a type hierarchy with a subclass annotated with
@Indexed(enabled = false)will now correctly ignore that subclass.
HSEARCH-3999: Deleting an entity whose
@ElementCollectionis indexed-embedded in another entity no longer leads to
HSEARCH-4009: Fixed a corner case where
@IndexingDependency(derivedFrom = …)would lead to bootstrap failure.
HSEARCH-4011: Hibernate Search
ScrollableResultsnow throw a JPA
QueryTimeoutExceptionon timeout instead of
ScrollResult.timedOut()sometimes used to return false even though a timeout occurred with Lucene; this was fixed.
SearchResultTotalnow correctly reports an approximate total hit count after a timeout.
HSEARCH-3917: Performance improvement: Hibernate Search now uses
TopFieldDocCollectorwhen a descending score sort is requested explicitly (not just when it’s the implicit default).
HSEARCH-3947: Performance improvement: Hibernate Search no longer creates huge arrays for collectors when a query does not set a limit to the amount of retrieved hits and there are fewer than 10,000 hits.
HSEARCH-4017: Performance improvement: the Lucene backend no longer scans index segments that don’t contain any returned hit when extracting projections.
HSEARCH-4018: Performance improvement: the Lucene backend now skips some filters when an index doesn’t have any nested documents.
HSEARCH-4019: Performance improvement: the Lucene backend now only uses a
TotalHitCountCollectorwhen absolutely necessary.
And more. For a full list of changes since the previous releases, please see the release notes.
All details are available and up to date on the dedicated page on hibernate.org.