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

Projection

In the first couple of chapters, our example application fetched all the matching entities in one big database call. We introduced pagination in Chapter 3, Performing Queries, to at least limit the database calls to a fixed number of rows. However, since we're already searching data in a Lucene index to begin with, is it really necessary to go to the database at all?

Hibernate Search offers projections as a technique for eliminating, or at least reducing, database access. A projection-based search returns only specific fields pulled from Lucene, rather than returning a full entity object from the database. You can then go to the database and fetch full objects if necessary, but the fields available in Lucene may be sufficient by themselves. ...

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