You are here

public function Search::removeSuggester in Search API Autocomplete 8

Removes a suggester from this search.

Parameters

string $suggester_id: The ID of the suggester to remove.

Return value

$this

Overrides SearchInterface::removeSuggester

File

src/Entity/Search.php, line 281

Class

Search
Describes the autocomplete settings for a certain search.

Namespace

Drupal\search_api_autocomplete\Entity

Code

public function removeSuggester($suggester_id) {

  // Depending on whether the suggesters have already been loaded, we have to
  // either remove the settings or the instance.
  if ($this->suggesterInstances === NULL) {
    unset($this->suggester_settings[$suggester_id]);
  }
  else {
    unset($this->suggesterInstances[$suggester_id]);
  }
  unset($this->suggester_weights[$suggester_id]);
  unset($this->suggester_limits[$suggester_id]);
  return $this;
}