src/wcmf/application/controller/SearchIndexController.php
protected function index($oids) {
    $persistenceFacade = $this->getPersistenceFacade();
    foreach($oids as $oid) {
      if (ObjectId::isValid($oid)) {
        $obj = $persistenceFacade->load($oid);
        if ($obj) {
          $this->search->addToIndex($obj);
        }
      }
    }
    $this->search->commitIndex(false);

    if ($this->getStepNumber() == $this->getNumberOfSteps()) {
      $this->addWorkPackage($this->getMessage()->getText('Optimizing index'),
              1, [0], 'optimize');
    }
  }
protected function index($oids) {
    $persistenceFacade = $this->getPersistenceFacade();
    foreach($oids as $oid) {
      if (ObjectId::isValid($oid)) {
        $obj = $persistenceFacade->load($oid);
        if ($obj) {
          $this->search->addToIndex($obj);
        }
      }
    }
    $this->search->commitIndex(false);

    if ($this->getStepNumber() == $this->getNumberOfSteps()) {
      $this->addWorkPackage($this->getMessage()->getText('Optimizing index'),
              1, [0], 'optimize');
    }
  }
protected function index ( $ oids ) { $ persistenceFacade = $ this -> getPersistenceFacade ( ) ; foreach ( $ oids as $ oid ) { if ( ObjectId :: isValid ( $ oid ) ) { $ obj = $ persistenceFacade -> load ( $ oid ) ; if ( $ obj ) { $ this -> search -> addToIndex ( $ obj ) ; } } } $ this -> search -> commitIndex ( false ) ; if ( $ this -> getStepNumber ( ) == $ this -> getNumberOfSteps ( ) ) { $ this -> addWorkPackage ( $ this -> getMessage ( ) -> getText ( 'Optimizing index' ) , 1 , [ 0 ] , 'optimize' ) ; } }
Create the lucene index from the given objects
@param $oids The oids to process
@note This is a callback method called on a matching work package @see BatchController::addWorkPackage()
Create the lucene index from the given objects