Following HSEARCH-1096, entities with {{ @Transient }} indexed fields are always reindexed upon entity update, regardless of the dirty properties. This is fine, because Hibernate Search cannot know which properties the indexed fields depend on, but this may lead to performance nightmares, where simple changes trigger a full, resource-intensive reindexing of an entity and all its related {{@ContainedIn}} entities.
In HSEARCH-1093, it was proposed to add a way for users to indicate which properties a given {{@Transient}} indexed fields field depend on. This has not been developed yet, probably because it would be quite complex. Another solution to this issue would be to provide a way for users to indicate which properties are *never* used in {{@Transient}} indexed fields. This way, if a user performs very frequently a tiny update operation on his entities that should not impact the indexes, the user only has to annotate the properties involved in this update operation. Then, when Hibernate performs the update, Hibernate Search will detect that the only changed fields are irrelevant to the indexes, and thus will skip the indexing. About the name of this annotation, there are a few possibilities: {{@DirtyIgnore}}, {{@IndexIgnore}}, {{@IndexTransient}}, ... My personnal favorite is {{@IndexTransient}}, because I think it more closely translates the characteristics that the annotated property should have.
I already implemented this in our own project, by heavily overriding some key classes of Hibernate (most notably the FullTextIndexEventListener), but I think moving this implementation directly to Hibernate Search would prove very simple (20 to 30 lines of code). So, the question is: if I did provide a pull request, would this feature be accepted? |
|