O'Reilly logo

Hibernate Search in Action by John Griffin, Emmanuel Bernard

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 6. Querying with Hibernate Search

This chapter covers
  • Creating and executing a Hibernate Search query
  • Using pagination
  • Using projection
  • Converting results in a different structure (ResultTransformer)
  • Defining a fetching strategy

Hibernate Search queries are the key component shielding your application from the mismatches between the index model and the domain model and helping you to migrate queries from SQL, HQL, or Criteria to full-text queries easily. Building a full-text query with Hibernate Search consists of two steps:

  1. Build a Lucene query to express the full-text search (either through the query parser or the programmatic API).
  2. Build a Hibernate Search query that wraps the Lucene query.

But first you need to understand why ...

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