apachesolr_views_handler_filter_single.inc in Apache Solr Views 6
File
handlers/apachesolr_views_handler_filter_single.inc
View source
<?php
class apachesolr_views_handler_filter_single extends views_handler_filter_string {
function query() {
if ($this->operator == '!=') {
$field = "NOT " . $this->value['value'];
}
else {
$field = $this->value['value'];
}
$this->query
->add_filter($this->real_field, $field);
}
function options_form(&$form, &$form_state) {
parent::options_form($form, $form_state);
unset($form['case']);
}
function operators() {
$operators = array(
'=' => array(
'title' => t('Is equal to'),
'short' => t('='),
'method' => 'op_equal',
'values' => 1,
),
'!=' => array(
'title' => t('Is not equal to'),
'short' => t('!='),
'method' => 'op_equal',
'values' => 1,
),
);
return $operators;
}
}