Flowpack.ElasticSearch icon indicating copy to clipboard operation
Flowpack.ElasticSearch copied to clipboard

remove object from index removes complete index

Open thomasblass opened this issue 9 years ago • 3 comments

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:

  1. Change the Aspect
  2. Change how the PersistenceManager->getIdentifierByObject works
  3. do something else ;-)

Can somebody support me for this case please?

thomasblass avatar May 06 '15 10:05 thomasblass

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

skurfuerst avatar Jun 10 '15 09:06 skurfuerst

As soon as the PSR change is merged I take care to change the aspect to run Before the method remove().

dfeyer avatar Nov 16 '15 14:11 dfeyer

thanks :+1:

skurfuerst avatar Nov 17 '15 11:11 skurfuerst