Document/Subscriber/ArticleSubscriber.php
public function handleUnpublish(UnpublishEvent $event)
    {
        $document = $event->getDocument();
        if (!$document instanceof ArticleDocument) {
            return;
        }

        $this->liveIndexer->remove($document);
        $this->liveIndexer->flush();

        $this->indexer->setUnpublished($document->getUuid(), $event->getLocale());
        $this->indexer->flush();
    }
public function handleUnpublish(UnpublishEvent $event)
    {
        $document = $event->getDocument();
        if (!$document instanceof ArticleDocument) {
            return;
        }

        $this->liveIndexer->remove($document);
        $this->liveIndexer->flush();

        $this->indexer->setUnpublished($document->getUuid(), $event->getLocale());
        $this->indexer->flush();
    }
public function handleUnpublish ( UnpublishEvent $ event ) { $ document = $ event -> getDocument ( ) ; if ( ! $ document instanceof ArticleDocument ) { return ; } $ this -> liveIndexer -> remove ( $ document ) ; $ this -> liveIndexer -> flush ( ) ; $ this -> indexer -> setUnpublished ( $ document -> getUuid ( ) , $ event -> getLocale ( ) ) ; $ this -> indexer -> flush ( ) ; }
Removes document from live index and unpublish document in default index.

@param UnpublishEvent $event
Removes document from live index and unpublish document in default index .