Classes/Indexer/NodeIndexer.php
public function removeNode(NodeInterface $node, string $targetWorkspaceName = null)
    {
        if ($this->settings['indexAllWorkspaces'] === false) {
            // we are only supposed to index the live workspace.
            // We need to check the workspace at two occasions; checking the
            // $targetWorkspaceName and the workspace name of the node's context as fallback
            if ($targetWorkspaceName !== null && $targetWorkspaceName !== 'live') {
                return;
            }

            if ($targetWorkspaceName === null && $node->getContext()->getWorkspaceName() !== 'live') {
                return;
            }
        }

        $documentIdentifier = $this->calculateDocumentIdentifier($node, $targetWorkspaceName);

        $this->currentBulkRequest[] = $this->documentDriver->delete($node, $documentIdentifier);
        $this->currentBulkRequest[] = $this->indexerDriver->fulltext($node, [], $targetWorkspaceName);

        $this->logger->log(sprintf('NodeIndexer (%s): Removed node %s (%s) from index.', $documentIdentifier, $node->getContextPath(), $node->getIdentifier()), LOG_DEBUG, null, 'ElasticSearch (CR)');
    }
public function removeNode(NodeInterface $node, string $targetWorkspaceName = null)
    {
        if ($this->settings['indexAllWorkspaces'] === false) {
            // we are only supposed to index the live workspace.
            // We need to check the workspace at two occasions; checking the
            // $targetWorkspaceName and the workspace name of the node's context as fallback
            if ($targetWorkspaceName !== null && $targetWorkspaceName !== 'live') {
                return;
            }

            if ($targetWorkspaceName === null && $node->getContext()->getWorkspaceName() !== 'live') {
                return;
            }
        }

        $documentIdentifier = $this->calculateDocumentIdentifier($node, $targetWorkspaceName);

        $this->currentBulkRequest[] = $this->documentDriver->delete($node, $documentIdentifier);
        $this->currentBulkRequest[] = $this->indexerDriver->fulltext($node, [], $targetWorkspaceName);

        $this->logger->log(sprintf('NodeIndexer (%s): Removed node %s (%s) from index.', $documentIdentifier, $node->getContextPath(), $node->getIdentifier()), LOG_DEBUG, null, 'ElasticSearch (CR)');
    }
public function removeNode ( NodeInterface $ node , string $ targetWorkspaceName = null ) { if ( $ this -> settings [ 'indexAllWorkspaces' ] === false ) { // we are only supposed to index the live workspace. // We need to check the workspace at two occasions; checking the // $targetWorkspaceName and the workspace name of the node's context as fallback if ( $ targetWorkspaceName !== null && $ targetWorkspaceName !== 'live' ) { return ; } if ( $ targetWorkspaceName === null && $ node -> getContext ( ) -> getWorkspaceName ( ) !== 'live' ) { return ; } } $ documentIdentifier = $ this -> calculateDocumentIdentifier ( $ node , $ targetWorkspaceName ) ; $ this -> currentBulkRequest [ ] = $ this -> documentDriver -> delete ( $ node , $ documentIdentifier ) ; $ this -> currentBulkRequest [ ] = $ this -> indexerDriver -> fulltext ( $ node , [ ] , $ targetWorkspaceName ) ; $ this -> logger -> log ( sprintf ( 'NodeIndexer (%s): Removed node %s (%s) from index.' , $ documentIdentifier , $ node -> getContextPath ( ) , $ node -> getIdentifier ( ) ) , LOG_DEBUG , null , 'ElasticSearch (CR)' ) ; }
Schedule node removal into the current bulk request.

@param NodeInterface $node
@param string $targetWorkspaceName
@return void
@throws \Neos\Flow\Persistence\Exception\IllegalObjectTypeException
Schedule node removal into the current bulk request .