I have a relation like so
@Indexed public class Group { @Field private String someField; @Field private boolean someBoolean; @OneToMany(mappedBy="group") @LazyCollection(LazyCollectionOption.EXTRA) @ContainedIn private Set<Post> posts; }
@Indexed public class Post{
@ManyToOne @IndexedEmbedded(includePaths= {"someBoolean"}
) private Group group; }
This is basically a reverse indexedembedded scenario.
In this scenario, if I change group.someField, the related Posts should not be reindexed, because the field they reference is not dirty. However, that doesn't seem to be the case. I execute a flush which includes a flushToIndexes and I'm seeing this ContainedIn relation being initialized.
It seems like ContainedIn is not protected by dirty checking for the reverse IndexedEmbedded.
So, it's not only initializing the entire collection unnecessarily, but I'm also not seeing the ExtraLazy annotation being honoured.
|