You are here

public function SearchApiIndex::postCreate in Search API 7

Execute necessary tasks for a newly created index.

File

includes/index_entity.inc, line 185
Contains SearchApiIndex.

Class

SearchApiIndex
Class representing a search index.

Code

public function postCreate() {
  try {
    if ($server = $this
      ->server()) {

      // Tell the server about the new index.
      $server
        ->addIndex($this);
      if ($this->enabled) {
        $this
          ->queueItems();
      }
    }
  } catch (SearchApiException $e) {
    watchdog_exception('search_api', $e);
  }
}