Every time an entity class is annotated with
@Indexed, by default Hibernate Search will create a Lucene index just for that class. We can have as many entities, and as many separate indexes, as we wish. However, searching each index separately would be a very awkward and cumbersome approach.
Most Hibernate ORM data models already capture the various associations between entity classes. When we search an entity's Lucene index, shouldn't Hibernate Search follow those associations? In this section we will see how to make it do just that.
So far, the entity fields in our example application have been simple data types. The
App class represents a table named
APP, and its member variables map to columns ...