You are here

public function FuzzySearchService::removeIndex in Fuzzy Search 7

Implements SearchApiServiceInterface::__construct().

By default, removes all items from that index.

Overrides SearchApiAbstractService::removeIndex

1 call to FuzzySearchService::removeIndex()
FuzzySearchService::addIndex in includes/service.inc
Implements SearchApiServiceInterface::__construct().

File

includes/service.inc, line 337

Class

FuzzySearchService
Search service class using the database for storing index information.

Code

public function removeIndex($index) {
  $id = is_object($index) ? $index->machine_name : $index;
  if (!isset($this->options['indexes'][$id])) {
    return;
  }
  $set = $this
    ->setDb();
  foreach ($this->options['indexes'][$id] as $field) {
    db_drop_table($field['table']);
  }
  if ($set) {
    $this
      ->resetDb();
  }
  unset($this->options['indexes'][$id]);
  $this->server
    ->save();
}