Flowpack.ElasticSearch
Flowpack.ElasticSearch copied to clipboard
remove object from index removes complete index
when you have a model with Custom Id Property and not standard-name "persistence_object_identifier", the aspect on the delete method trys to find the Id of the object which was removed. this fails because the object is already deleted so it returns NULL and the call to elastic-search is DELETE/[index]/[type]/
I could track the issue down to "ObjectIndexer.removeObject"
$id = $this->persistenceManager->getIdentifierByObject($object);
Here the Persistence Manager returns NULL
If I change the Aspect to run before, everything works fine:
- @Flow\Before("setting(TYPO3.TYPO3CR.Search.realtimeIndexing.enabled) && within(TYPO3\Flow\Persistence\PersistenceManagerInterface) && method(public .+->(remove)())")
So we have different possible solutions for this:
- Change the Aspect
- Change how the PersistenceManager->getIdentifierByObject works
- do something else ;-)
Can somebody support me for this case please?
Hey Thomas,
Sorry for not responding so long - I was not notified on these issues.
I'd suggest to fix this in the ElasticSearch package.
Thanks a lot for your help, Sebastian
As soon as the PSR change is merged I take care to change the aspect to run Before the method remove().
thanks :+1: