Пример #1
0
 /**
  * Drops and recreates the index. So one can start indexing.
  *
  * @return boolean
  */
 public function startIndex()
 {
     if ($this->storage->isExists()) {
         $this->storage->drop();
     }
     if ($this->dictionary->isExists()) {
         $this->dictionary->drop();
     }
     $this->dictionary->create();
     $this->storage->create();
     return true;
 }
Пример #2
0
 /**
  * Drops all related to index database structures.
  *
  * @param integer $iblockId Information block identifier.
  *
  * @return void
  * @throws \Bitrix\Main\Db\SqlQueryException
  */
 public static function dropIfExists($iblockId)
 {
     $storage = new Storage($iblockId);
     if ($storage->isExists()) {
         $storage->drop();
     }
     $dictionary = new Dictionary($iblockId);
     if ($dictionary->isExists()) {
         $dictionary->drop();
     }
 }