/**
  * @see xfIndex
  */
 public function qubitPopulate($options)
 {
     $conn = Propel::getConnection();
     $start = microtime(true);
     $this->getLogger()->log('Populating index...', $this->getName());
     // if we are using an offset to resume from a segfault, optimize the index instead of deleting
     if (!isset($options['actorOffset']) && !isset($options['ioOffset'])) {
         $this->getEngine()->erase();
         $this->getLogger()->log('Index erased.', $this->getName());
     } else {
         $this->optimize();
     }
     // set buffering and updates to be batched for better performance
     // NB: not sure why this doesn't work in object scope
     self::getInstance()->getEngine()->enableBatchMode();
     $actorOffset = intval($options['actorOffset']);
     $ioOffset = intval($options['ioOffset']);
     // index actors
     if (-1 < $actorOffset) {
         // Get count of all actors
         $sql = 'SELECT COUNT(*) from ' . QubitActor::TABLE_NAME;
         $rs = $conn->query($sql);
         $rowcount = $rs->fetchColumn(0);
         // Get actors (with offset)
         $criteria = new Criteria();
         QubitActor::addSelectColumns($criteria);
         if (0 < $actorOffset) {
             $criteria->setOffset($actorOffset);
         }
         $actors = QubitActor::get($criteria);
         // Loop through results, and add to search index
         foreach ($actors as $key => $actor) {
             if ($key == 0 && 0 < $actorOffset) {
                 $this->getLogger()->log('Ignoring first ' . $actorOffset . ' actors.');
             }
             self::addActorIndex($actor);
             $this->getLogger()->log('"' . $actor->__toString() . '" inserted (' . round(microtime(true) - $start, 2) . 's) (' . ($key + $actorOffset + 1) . '/' . $rowcount . ')', $this->getName());
         }
     } else {
         $this->getLogger()->log('Actors are ignored.');
     }
     // index information objects
     if (-1 < $ioOffset) {
         // Get count of all information objects
         $sql = 'SELECT COUNT(*) from ' . QubitInformationObject::TABLE_NAME;
         $rs = $conn->query($sql);
         $rowcount = $rs->fetchColumn(0);
         // Get info objects (with offset)
         $criteria = new Criteria();
         QubitInformationObject::addSelectColumns($criteria);
         if (0 < $ioOffset) {
             $criteria->setOffset($ioOffset);
         }
         $informationObjects = QubitInformationObject::get($criteria);
         // Loop through results, and add to search index
         foreach ($informationObjects as $key => $informationObject) {
             if ($key == 0 && 0 < $ioOffset) {
                 $this->getLogger()->log('Ignoring first ' . $ioOffset . ' information objects.');
             }
             if (0 < count($languages = $this->getTranslatedLanguages($informationObject))) {
                 foreach ($languages as $language) {
                     self::addInformationObjectIndex($informationObject, $language, $options);
                 }
             }
             $this->getLogger()->log('"' . $informationObject->__toString() . '" inserted (' . round(microtime(true) - $start, 2) . 's) (' . ($key + $ioOffset + 1) . '/' . $rowcount . ')', $this->getName());
         }
     } else {
         $this->getLogger()->log('Information objects are ignored.');
     }
     $this->getLogger()->log('Index populated in "' . round(microtime(true) - $start, 2) . '" seconds.', $this->getName());
 }