Red Hat

In Relation To WildFly

In Relation To WildFly

Sanne is going to do a virtual JBoss User Group session Tuesday July 14th at 6PM BST / 5PM UTC / 1PM EDT / 10 AM PDT. He is going to talk about Lucene in Java EE.

He will also describe some projects dear to our heart. If you want to know what Hibernate Search, Infinispan bring to the Lucene table and how they use Lucene internally, that’s the event to be in!

Apache Lucene is the de-facto standard open source library for Java developers to implement full-text-search capabilities.

While it’s thriving in its field, it is rarely mentioned in the scope of Java EE development.

In this talk we will see for which features many developers love Lucene, make some concrete examples of common problems it elegantly solves, and see some best practices about using it in a Java EE stack.

Finally we’ll see how some popular OSS projects such as Hibernate ORM (JPA provider), WildFly (Java EE runtime) and Infinispan (in-memory datagrid, JCache implementor) actually provide great Lucene integration capabilities.

If you are interested, get some more info on Meetup and enlist.

Hibernate Search 4.5.0.Final is available now.

This minor release could be promoted quickly as we didn't include any new feature compared to the 4.4 series, other than to focus on compatibility with Hibernate ORM 4.3 and WildFly 8 (JPA 2.1 and JavaEE 7 respectively).

WildFly 8 Integration

The WildFly application server will include this Hibernate Search version, making it even simpler to get started. Our documentation explains how to activate the module, but this will be outdated soon!

Essentially you need to either

  • Add a line to the MANIFEST of your deployment

or

  • Declare the dependency in a jboss-deployment-structure.xml file included in your deployment

The documentation still instructs to download the necessary modules, as that's required with WildFly 8.0.0.CR1, but this step should not be necessary in the final version of WildFly 8!

Of course, we'll still provide the same modules in future so that you won't be limited to use the version included in WildFly exclusively, but will always have the option to choose a different version.

OpenShift users

Since Hibernate Search is being included in WildFly 8, we're looking forward to it being available to all OpenShift users via the WildFly cartridge.

Why should you upgrade?

To remind on all the good reasons to update, these are the most notable improvements of the 4.5 branch:

JPA 2.1 compatibility

This Hibernate Search version is meant to work with Hibernate ORM 4.3.x series: our implementation for the JPA 2.1 standard, now included in WildFly 8.

Improved performance

Both Hibernate ORM and Hibernate Search are getting leaner at each release, allowing you to make better usage of your memory.

Simplified MassIndexer

The MassIndexer is now simpler to tune, and some problems related to lazy initialization exceptions where resolved.

<dependency>
 <groupId>org.hibernate</groupId>
 <artifactId>hibernate-search-orm</artifactId>
 <version>4.5.0.Final</version>
</dependency>

Next steps

We expect to start rolling out preview tags of Hibernate Search 5 very soon: this is going to be based on the highly requested Apache Lucene 4.

Consequentially the 4.5 branch is from now on in maintenance mode, and will receive only critical fixes or as contributed by goodwilling users.

See our Roadmap for an overview of the plan, and don't hesitate to send suggestions our way!

We just tagged and uploaded all artifacts for both:

  • Hibernate Search 4.4.0.Final - to be used with Hibernate ORM 4.2.x (JPA 2) and application servers using this version of ORM (JBoss EAP 6.1, JBoss AS 7.1)
  • Hibernate Search 4.5.0.Alpha1 - now compatible with Hibernate ORM 4.3 early betas (JPA 2.1) and application servers using it (WildFly 8.0.0.Beta1)

Hibernate Search 4.4.0.Final

Looking at the Migration Guide this is going to be an easy upgrade for all 4.3 users: once again the API is very stable. We would therefore advise all users to upgrade and take advantage of all the improvements at minimal pain, also to be able to address the couple of small deprecations in an iterative approach.

<dependency>
 <groupId>org.hibernate</groupId>
 <artifactId>hibernate-search-orm</artifactId>
 <version>4.4.0.Final</version>
</dependency>

Or download the distribution from Sourceforge.

The major new features

The 4.4 development cycle focused on three main features:

Dynamic index sharding

Very powerful, allows you to improve scalability and/or roll your own custom multi-tenancy policies on how to split data across indexes. Read the introductory blog post and the more advanced example.

Metadata API

You can now read through the Metadata API how each indexed entity is being mapped to the index. This is primarily meant for other framework and tooling integration, but is also useful if you want to generate your own advanced queries without being coupled to your specific model, for example to target all fields you can find out which fields there are. A practical example can be found on this blog post.

JBoss Modules for easy deployment

We had this as experimental feature in 4.3, it looks like quite solid now. The idea is to add Hibernate Search and its main dependencies like Apache Lucene and the custom Infinispan Directory as isolated modules in your JBoss application server so that you don't have to include any Search related jar in your deployments. It will wire-up classloader correctly to the other depending modules like Infinispan Core, JGroups and Hibernate ORM, and also you can include multiple different versions in the same container: module ids include versions! All it takes to access the module is a single line in the Manifest of your deployment, as explained in the reference documentation.

Bugfixes and minor improvements

There is quite a list of minor issues resolved, to summarize changes since 4.3.0.Final:

  • purge operations failing on @ContainedIn entities
  • Embedded ElementCollection (with FieldBridge) wouldn't trigger an index update
  • Some classloading fixes
  • AppliedOnTypeAwareBridge not being applied on Class Bridges, and didn't have norms or analyze methods.
  • Improve convergence of dependencies, remove some unnecessary dependencies
  • QueryBuilder more friendly towards super classes of indexed types
  • Improved graceful recovery from errors during document building
  • Lots of clarifications in the documentation

Lots of minor upgrades across our dependencies: Hibernate ORM to 4.2.6.Final, Infinispan 5.3.0.Final, Apache Tika 1.4, Apache Avro 1.7.5, JGroups 3.3.5.Final, Narayana 4.17.7.Final, JBoss Logging 3.1.0.GA, .. all latest stable versions. Apache Lucene stays stable at version 3.6.2.

Hibernate Search 4.5.0.Alpha1

This is quite similar to Hibernate Search 4.4.0.Final, but is compatible with the latest Hibernate ORM 4.3.0.Beta5 and Infinispan 6.0.0.CR1, making it suitable for usage on WildFly 8.0.0.Beta1. Hibernate 4.4.0.Final is NOT compatible with these, sorry we tried hard but it wasn't technically possible without major changes in the previous (stable) versions of the ORM and Infinispan dependencies, on top of which you'd have had to wait for another WildFly release so we decided to accelerate the 4.5 release cycle instead.

<dependency>
 <groupId>org.hibernate</groupId>
 <artifactId>hibernate-search-orm</artifactId>
 <version>4.5.0.Alpha1</version>
</dependency>

Or download the distribution from Sourceforge.

Hibernate Search 4.5.0.Alpha1 also includes JBoss Modules to simplify deployment on the application server, but these are strictly meant for WidlFly only (please forgive the name and documentation confusion for now).

What's next?

Version 4.5 will not receive much attention other than

  • keeping up with required changes for compatibility with latest Hibernate ORM and WildFly
  • improve (experimental) Infinispan automatic configuration
  • what you might want to contribute

Our main focus is going to be Apache Lucene 4 compatibility, therefore we'll create a 4.5 branch and from today master is going to be Hibernate Search 5.0.0-SNAPSHOT.

To propose changes and join the development team get in touch on the developer's mailing list. We expect high standards but are willing to help you getting there: any development question is welcome. For usage related questions or if you're unsure write on which list is more appropriate write us on the forums.

The issue tracker is JIRA and all code is on GitHub: pull requests and any feedback welcome.

back to top