Skip to content

Commit

Permalink
BUGFIX: remove nodes from index on discard
Browse files Browse the repository at this point in the history
  • Loading branch information
dimaip committed Mar 13, 2018
1 parent 0ae0506 commit c3b86ad
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions Classes/Package.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
use Neos\Flow\Package\Package as BasePackage;
use Neos\Flow\Persistence\Doctrine\PersistenceManager;
use Neos\ContentRepository\Domain\Model\Node;
use Neos\ContentRepository\Domain\Service\PublishingService;
use Neos\ContentRepository\Domain\Model\Workspace;

/**
Expand Down Expand Up @@ -57,6 +58,8 @@ public function registerIndexingSlots(Bootstrap $bootstrap)
$bootstrap->getSignalSlotDispatcher()->connect(Node::class, 'nodeAdded', Indexer\NodeIndexingManager::class, 'indexNode', false);
$bootstrap->getSignalSlotDispatcher()->connect(Node::class, 'nodeUpdated', Indexer\NodeIndexingManager::class, 'indexNode', false);
$bootstrap->getSignalSlotDispatcher()->connect(Node::class, 'nodeRemoved', Indexer\NodeIndexingManager::class, 'removeNode', false);
// discard needs to be handled separately as it does not emit `nodeRemoved`
$bootstrap->getSignalSlotDispatcher()->connect(PublishingService::class, 'nodeDiscarded', Indexer\NodeIndexingManager::class, 'removeNode', false);
// all publishing calls (Workspace, PublishingService) eventually trigger this - and publishing is triggered in various ways
$bootstrap->getSignalSlotDispatcher()->connect(Workspace::class, 'afterNodePublishing', Indexer\NodeIndexingManager::class, 'indexNode', false);
// make sure we always flush at the end, regardless of indexingBatchSize
Expand Down

0 comments on commit c3b86ad

Please sign in to comment.