You are here

function elasticsearch_connector_views_keyword_handler_filter::query in Elasticsearch Connector 7.5

Same name and namespace in other branches
  1. 7 modules/elasticsearch_connector_views/handlers/elasticsearch_connector_views_keyword_handler_filter.inc \elasticsearch_connector_views_keyword_handler_filter::query()
  2. 7.2 modules/elasticsearch_connector_views/handlers/elasticsearch_connector_views_keyword_handler_filter.inc \elasticsearch_connector_views_keyword_handler_filter::query()

Add this filter to the query.

Due to the nature of fapi, the value and the operator have an unintended level of indirection. You will find them in $this->operator and $this->value respectively.

Overrides views_handler_filter::query

File

modules/elasticsearch_connector_views/handlers/elasticsearch_connector_views_keyword_handler_filter.inc, line 7
Fulltext keyword search.

Class

elasticsearch_connector_views_keyword_handler_filter
@file Fulltext keyword search.

Code

function query() {
  if (!empty($this->value) && !empty($this->value[0])) {
    $this->query
      ->add_parameter('q', $this->value[0]);
  }
  if (!empty($this->options['fields'])) {
    $this->query
      ->add_parameter('fulltext_fields', $this->options['fields']);
  }
  if (!empty($this->operator)) {
    $this->query
      ->add_parameter('fulltext_operator', $this->operator);
  }
}