Whenever an entity is modified and something changes in an embedded object, Hibernate ORM will trigger an event that mentions “that embedded object changed”, but it won't tell us what changed exactly inside that embeddable (org.hibernate.event.spi.PostUpdateEvent#dirtyProperties contains the index of the embeddable property, nothing more). As a result, if the indexing of an entity depends on one property (P1) inside an embeddable, and another property (P2) in that embeddable changes, Hibernate Search currently has to reindex the entity “just to be safe”, because it doesn’t know whether P1 changed or P2 changed, just that “either P1 or P2 changed”. In short, we’ll reindex more often than necessary. This is actually a limitation of Hibernate ORM, so we should investigate whether we can improve things in Hibernate ORM itself. Maybe it’s already solved in Hibernate ORM 6? I doubt that, though. |