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

Chapter 3. Performing Queries

In the previous chapter, we created various types of persistent objects and mapped them to Lucene search indexes in various ways. However, we have basically used the same keyword query in all the versions of the example application so far.

In this chapter, we will explore other search query types offered by the Hibernate Search DSL, as well as important features such as sorting and pagination that are common to all of them.

Mapping API versus query API

So far, we discussed API alternatives for mapping classes to the database with Hibernate ORM. You can map your classes with XML or annotations, using JPA or the traditional API, and Hibernate Search will work fine so long as you are aware of some minor differences.

However, ...

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