Command/ReindexCommand.php
protected function indexDocuments($locale, IndexerInterface $indexer, OutputInterface $output)
    {
        $documents = $this->getDocuments($locale);
        $count = count($documents);
        if (0 === $count) {
            $output->writeln('  No documents found');

            return;
        }

        $progessBar = new ProgressBar($output, $count);
        $progessBar->setFormat(' %current%/%max% [%bar%] %percent:3s%% %elapsed:6s%/%estimated:-6s% %memory:6s%');
        $progessBar->start();

        foreach ($documents as $document) {
            $indexer->index($document);
            $progessBar->advance();
        }

        $indexer->flush();
        $progessBar->finish();
    }
protected function indexDocuments($locale, IndexerInterface $indexer, OutputInterface $output)
    {
        $documents = $this->getDocuments($locale);
        $count = count($documents);
        if (0 === $count) {
            $output->writeln('  No documents found');

            return;
        }

        $progessBar = new ProgressBar($output, $count);
        $progessBar->setFormat(' %current%/%max% [%bar%] %percent:3s%% %elapsed:6s%/%estimated:-6s% %memory:6s%');
        $progessBar->start();

        foreach ($documents as $document) {
            $indexer->index($document);
            $progessBar->advance();
        }

        $indexer->flush();
        $progessBar->finish();
    }
protected function indexDocuments ( $ locale , IndexerInterface $ indexer , OutputInterface $ output ) { $ documents = $ this -> getDocuments ( $ locale ) ; $ count = count ( $ documents ) ; if ( 0 === $ count ) { $ output -> writeln ( '  No documents found' ) ; return ; } $ progessBar = new ProgressBar ( $ output , $ count ) ; $ progessBar -> setFormat ( ' %current%/%max% [%bar%] %percent:3s%% %elapsed:6s%/%estimated:-6s% %memory:6s%' ) ; $ progessBar -> start ( ) ; foreach ( $ documents as $ document ) { $ indexer -> index ( $ document ) ; $ progessBar -> advance ( ) ; } $ indexer -> flush ( ) ; $ progessBar -> finish ( ) ; }
Index documents for given locale.

@param string $locale
@param IndexerInterface $indexer
@param OutputInterface $output
Index documents for given locale .