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 2. Mapping Entity Classes

In Chapter 1, Your First Application, we used core Hibernate ORM to map an entity class to a database table, and then we used Hibernate Search to map two of its fields to a Lucene index. By itself, this provides a lot of search functionality that would be very cumbersome to code from scratch.

However, real-world applications usually involve numerous entities, many of which should be available for searching. Entities may be associated with each other, and our queries need to understand those associations so that we can search across multiple entities at once. We might want to declare that some mappings are more relevant to a search than others, or we might want to skip indexing data under certain conditions.

In this ...

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