original_string: public function onIndexRebuild(IndexRebuildEvent $event)
      {
          foreach ($this->adapter->listIndexes() as $indexName) {
              if (!$this->indexNameDecorator->isVariant($this->indexNameDecorator->undecorate($indexName), $indexName)) {
                  continue;
              }
  
              $event->getOutput()->writeln(sprintf('<info>Optimizing zend lucene index:</info> %s', $indexName));
              $this->adapter->optimize($indexName);
          }
      }
code: public function onIndexRebuild(IndexRebuildEvent $event)
      {
          foreach ($this->adapter->listIndexes() as $indexName) {
              if (!$this->indexNameDecorator->isVariant($this->indexNameDecorator->undecorate($indexName), $indexName)) {
                  continue;
              }
  
              $event->getOutput()->writeln(sprintf('<info>Optimizing zend lucene index:</info> %s', $indexName));
              $this->adapter->optimize($indexName);
          }
      }
code_tokens: public function onIndexRebuild ( IndexRebuildEvent $ event ) { foreach ( $ this -> adapter -> listIndexes ( ) as $ indexName ) { if ( ! $ this -> indexNameDecorator -> isVariant ( $ this -> indexNameDecorator -> undecorate ( $ indexName ) , $ indexName ) ) { continue ; } $ event -> getOutput ( ) -> writeln ( sprintf ( '<info>Optimizing zend lucene index:</info> %s' , $ indexName ) ) ; $ this -> adapter -> optimize ( $ indexName ) ; } }
docstring: Optimize the search indexes after the index rebuild event has been fired.
  Should have a priority low enough in order for it to be executed after all
  the actual index builders.
  
  @param IndexRebuildEvent $event
docstring_tokens: Optimize the search indexes after the index rebuild event has been fired . Should have a priority low enough in order for it to be executed after all the actual index builders .