O'Reilly logo

Hibernate Search by Example by Steve Perkins

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Setting up a project for Hibernate Search and JPA

When your Maven-based project includes the hibernate-search dependency, it automatically pulls over three dozen related dependencies for you. Unfortunately, JPA query support is not one of them. To use JPA-style queries, we must declare an extra hibernate-entitymanager dependency ourselves.

Its version needs to match the version of hibernate-core that is already in the dependency hierarchy. This will not always be in sync with the hibernate-search version.

Your IDE may offer a way to present the dependency hierarchy visually. Either way, you can always use Maven from the command line to get the same information with this command:

mvn dependency:tree

As shown in this output, Hibernate Search version ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required