You are here

function elasticsearch_connector_views_handler_filter_string_autocomplete::op_empty in Elasticsearch Connector 7.2

Same name and namespace in other branches
  1. 7.5 modules/elasticsearch_connector_views/handlers/elasticsearch_connector_views_handler_filter_string_autocomplete.inc \elasticsearch_connector_views_handler_filter_string_autocomplete::op_empty()
  2. 7 modules/elasticsearch_connector_views/handlers/elasticsearch_connector_views_handler_filter_string_autocomplete.inc \elasticsearch_connector_views_handler_filter_string_autocomplete::op_empty()

Overrides views_handler_filter_string::op_empty

File

modules/elasticsearch_connector_views/handlers/elasticsearch_connector_views_handler_filter_string_autocomplete.inc, line 106
Handle the elasticsearch string fields autocomplete filter using views_autocomplete_filters.

Class

elasticsearch_connector_views_handler_filter_string_autocomplete
@file Handle the elasticsearch string fields autocomplete filter using views_autocomplete_filters.

Code

function op_empty($field) {
  if ($this->operator == 'empty') {
    $this->query
      ->add_where($this->options['group'], array(
      'missing' => array(
        'field' => $field,
      ),
    ));
  }
  else {
    $this->query
      ->add_where($this->options['group'], array(
      'exists' => array(
        'field' => $field,
      ),
    ));
  }
}