You are here

public function Solr_Base_Query::remove_filter in Apache Solr Search 5.2

Same name and namespace in other branches
  1. 6 Solr_Base_Query.php \Solr_Base_Query::remove_filter()
  2. 6.2 Solr_Base_Query.php \Solr_Base_Query::remove_filter()

Remove a filter from the query

Parameters

string $field: the facet field to remove

string $value: The facet value to remove This value can be NULL

Overrides Drupal_Solr_Query_Interface::remove_filter

File

./Solr_Base_Query.php, line 182

Class

Solr_Base_Query

Code

public function remove_filter($name, $value = NULL) {

  // We can only remove named fields.
  if (empty($name)) {
    return;
  }

  // Record the removal.
  $this->fields_removed[$name][] = $value;

  // Remove from the public list of filters.
  $this
    ->unset_filter($this->fields, $name, $value);

  // Remove from the list of filters added with add_filter()
  $this
    ->unset_filter($this->fields_added, $name, $value);
}