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 ...

Get Hibernate Search in Action now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.