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

Partial indexing

Associated entities each have their own Lucene index, and also store some data in each other's indexes. With embedded objects, search information is stored exclusively in the containing entity's index.

However, bear in mind that these classes may be associated or embedded in more than one place. For example, if you had the Customer and Publisher entities in your data model, both of them might have an embedded object of type Address.

Normally, we use the @Field annotation to tell Hibernate Search which fields should be indexed and searchable. However, what if we want this to vary with associated or embedded objects? What if we want a field to be indexed, or not indexed, depending on which other entity contains it? Hibernate Search ...

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