public function SearchApiText::operators in Search API 8
Defines the operators supported by this filter.
Return value
array[] An associative array of operators, keyed by operator ID, with information about that operator:
- title: The full title of the operator (translated).
- short: The short title of the operator (translated).
- method: The method to call for this operator in query().
- values: The number of values that this operator expects/needs.
Overrides SearchApiNumeric::operators
File
- src/
Plugin/ views/ filter/ SearchApiText.php, line 17
Class
- SearchApiText
- Defines a filter for filtering on fulltext fields.
Namespace
Drupal\search_api\Plugin\views\filterCode
public function operators() {
$operators = parent::operators();
$operators['=']['title'] = $this
->t('contains');
$operators['!=']['title'] = $this
->t("doesn't contain");
$supported_operators = [
'=' => 1,
'!=' => 1,
'empty' => 1,
'not empty' => 1,
];
$operators = array_intersect_key($operators, $supported_operators);
return $operators;
}