We just published Hibernate Search 6.0.0.Beta7.
This release mainly improves sorts and aggregations on multi-valued or nested fields, introduces dynamic index fields through field templates, restores the index metamodel, and restores low-level Lucene settings. It also includes an upgrade to Hibernate ORM 5.4.15.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.
What’s more, both sorts and aggregations now support filtering when the field being sorted/aggregated on is located in a nested document (HSEARCH-3846, HSEARCH-3881). This is particularly useful to sort on a field that is usually multi-valued, but becomes single-valued after you apply the criteria of your query. Think of a search on t-shirts, sorting by price, where each t-shirt has multiple sizes with its own price; when searching for a specific t-shirt size, you’ll want to sort on the price of each t-shirt for that size only. See the reference documentation for details and examples: here for sorts and here for aggregations.
Many thanks to Waldemar Kłaczyński for providing the groundwork that made this possible.
As of HSEARCH-3273, it is now possible to add fields to documents even if they weren’t declared beforehand, provided you declared matching field templates.
This means you can implement a bridge that will index a schema-less JSON object, for example,
provided the properties of JSON objects are named following specific conventions that you can set yourself
*_int for integers,
*_txt for text, etc.).
You can declare field templates by defining custom bridges; see this section of the reference documentation for more information.
HSEARCH-3907: Upgrade to Hibernate ORM 5.4.15.Final
Hibernate Search 6 requires ORM 5.4.4.Final or later to work correctly. Earlier 5.4.x versions will not work correctly.
SearchQuery.explain(String, String)now expects to be passed the name of a mapped type, instead of the name of an index.
HSEARCH-3886: Documents with missing values are now sorted last by default in sorts by field value, instead of being inserted next to "zero" values.
.fetchon the same
SearchQuerymultiple times now works correctly.
HSEARCH-3901: The context passed to
TypeMappingAnnotationProcessornow exposes an
annotatedElement()method to inspect the annotated element (type, name and annotations).
LuceneSearchResultnow exposes a
LuceneSearchQuerynow exposes a
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.