Document/Subscriber/ArticleSubscriber.php
public function handleFlush(FlushEvent $event)
    {
        if (count($this->documents) < 1) {
            return;
        }

        foreach ($this->documents as $documentData) {
            $document = $this->documentManager->find($documentData['uuid'], $documentData['locale']);
            $this->documentManager->refresh($document);

            $this->indexer->index($document);
        }
        $this->indexer->flush();
        $this->documents = [];
    }
public function handleFlush(FlushEvent $event)
    {
        if (count($this->documents) < 1) {
            return;
        }

        foreach ($this->documents as $documentData) {
            $document = $this->documentManager->find($documentData['uuid'], $documentData['locale']);
            $this->documentManager->refresh($document);

            $this->indexer->index($document);
        }
        $this->indexer->flush();
        $this->documents = [];
    }
public function handleFlush ( FlushEvent $ event ) { if ( count ( $ this -> documents ) < 1 ) { return ; } foreach ( $ this -> documents as $ documentData ) { $ document = $ this -> documentManager -> find ( $ documentData [ 'uuid' ] , $ documentData [ 'locale' ] ) ; $ this -> documentManager -> refresh ( $ document ) ; $ this -> indexer -> index ( $ document ) ; } $ this -> indexer -> flush ( ) ; $ this -> documents = [ ] ; }
Index all scheduled article documents with default indexer.

@param FlushEvent $event
Index all scheduled article documents with default indexer .