You are here

function elasticsearch_connector_views_handler_filter_string_autocomplete::op_word 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_word()
  2. 7 modules/elasticsearch_connector_views/handlers/elasticsearch_connector_views_handler_filter_string_autocomplete.inc \elasticsearch_connector_views_handler_filter_string_autocomplete::op_word()

Overrides views_handler_filter_string::op_word

File

modules/elasticsearch_connector_views/handlers/elasticsearch_connector_views_handler_filter_string_autocomplete.inc, line 36
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_word($field) {
  $where = $this->operator == 'word' ? "or" : "and";

  // Don't filter on empty strings.
  if (empty($this->value)) {
    return;
  }
  $this->query
    ->add_where($this->options['group'], array(
    'query' => array(
      'match' => array(
        $field => array(
          'query' => $this->value,
          'type' => $where,
        ),
      ),
    ),
  ));
}