As part of the HSEARCH-1573 issue, we are bringing back the old behavior of having the ability to define a dependency graph of indexing with the @ContainedIn annotation. This ability was supported before 4.4 and removed during the 4.4 development cycle, mostly because it was accidentally supported.
Currently, @ContainedIn is mostly described in the docs as the counterpart of @IndexedEmbedded and not as a way to define a dependency.
HSEARCH-1573 and the associated pull request contains interesting test cases about this feature but I'll summarize this here.
The main objective of this ticket is to decide how we want to provide a way to do the following:
@Entity
@Indexed
public class MyEntity {
@WhenEverMyEntityIsReindexedAlsoReindexThisOne
private MyOtherEntity other;
}
The current state of the discussion is to:
-
either add a new annotation doing exactly that but with a clever name;
-
or add a parameter to the @ContainedIn annotation to mark the @IndexedEmbedded counterpart as not really needed.
Our opinion at Open Wide is that @ContainedIn is the natural annotation to do so... mostly because we naturally used it without giving it a second thought and we were surprised it was broken in 4.4.
I think the central question is: does the fact that we can identify specifically this usage bring us something? Or will it bring us something in the future?
If not, a doc patch is probably fine. Otherwise let's go for some bikeshedding on the clever names!
|