| org.hibernate.search.mapper.pojo.work.impl.PojoIndexedTypeIndexingPlan.IndexedEntityIndexingPlan#purge sets entitySupplier to null:
void purge() {
entitySupplier = null;
shouldResolveToReindex = false;
considerAllDirty = false;
dirtyPaths = null;
add = false;
delete = true;
}
But then the actual execution of the purge will try to retrieve the routing key, which will involve dereferencing the entitySupplier. For example org.hibernate.search.backend.lucene.work.execution.impl.LuceneIndexIndexingPlan#delete:
@Override
public void delete(DocumentReferenceProvider referenceProvider) {
String id = referenceProvider.getIdentifier();
String routingKey = referenceProvider.getRoutingKey();
collect( id, routingKey, factory.delete( tenantId, id ) );
}
Two problems to solve: 1. When the user doesn't use routing key, this should work fine and not throw an NPE. 2. When the user does use routing key, we should expect users to provide the routing key to org.hibernate.search.mapper.orm.work.SearchIndexingPlan#purge(java.lang.Class<?>, java.lang.Object)/org.hibernate.search.mapper.orm.work.SearchIndexingPlan#purge(java.lang.String, java.lang.Object). Let's just add a String parameter. |