public function Solr_Base_Query::remove_filter in Apache Solr Search 6.2
Same name and namespace in other branches
- 5.2 Solr_Base_Query.php \Solr_Base_Query::remove_filter()
- 6 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: (optional) The facet value to remove. Defaults to NULL.
Overrides Drupal_Solr_Query_Interface::remove_filter
File
- ./
Solr_Base_Query.php, line 189
Class
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 record of added filters.
$this
->unset_filter($this->fields_added, $name, $value);
}