I have a problem that I think should be easily resolved.
I use Hibernate Search to index @Entitiy classes that are related to other objects.
Whenever an entity points to another object that also needs to be indexed, say the User who uploaded a particular photo, I use @IndexedEmbedded, which worked fine with HSearch auto indexing.
However, I also have @IndexedEmbeded annotations defined for @ManyToOne relationships. Imagine a photo with a list of related comments. These are loaded by default with lazy loading, i.e. They are not retrieved from the database until they are needed. I noticed that when I add a comment, no matter how much time has passed, it is not indexed until I manually reindex. Then everything works fine. I have not observed this with any of the other IndexedEmbedded relationships that I have, for example, if I change the location of the photo, after a few minutes it falls into the index and is perfectly visible.
Any explanation? Decision?
source share