|
Hi Hardy,
Here is my attempt to fix the issue: https://github.com/openwide-java/hibernate-search/commit/8ddad809c82b6b21817dcdc5bb3cc262dbe8f855 using the idea of Yoann.
If you're OK with it, I can push a PR.
To illustrate the problem I have with your patch, consider the following pseudo code:
@MappedSuperClass
com.company.collection1.MyAbstractClass
@CollectionOfElements
@Field(fieldBridge...)
private List<String> collection1;
and
@Entity
com.company.collection1.MyEntity
@CollectionOfElements
private List<String> myNonIndexedCollection;
Hibernate Search knows that collection1 should be considered an indexed collection and myNonIndexedCollection should not.
Consider the following update operation:
-
I update myNonIndexedCollection
-
I don't update collection1
-> Search should decide that it doesn't have to reindex the object.
But when it tries to do so with your patch, it checks if com.company.collection1.MyEntity.myNonIndexedCollection is matching ^(\w+\.)
collection1(\.\w
)*$ and it does. So it's going to reindex the entity even if it's not necessary.
|