You are here

public function ElasticsearchViewsFulltextSearch::query in Elasticsearch Connector 8.6

Same name and namespace in other branches
  1. 8.7 modules/elasticsearch_connector_views/src/Plugin/views/filter/ElasticsearchViewsFulltextSearch.php \Drupal\elasticsearch_connector_views\Plugin\views\filter\ElasticsearchViewsFulltextSearch::query()
  2. 8.2 modules/elasticsearch_connector_views/src/Plugin/views/filter/ElasticsearchViewsFulltextSearch.php \Drupal\elasticsearch_connector_views\Plugin\views\filter\ElasticsearchViewsFulltextSearch::query()
  3. 8.5 modules/elasticsearch_connector_views/src/Plugin/views/filter/ElasticsearchViewsFulltextSearch.php \Drupal\elasticsearch_connector_views\Plugin\views\filter\ElasticsearchViewsFulltextSearch::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 FilterPluginBase::query

File

modules/elasticsearch_connector_views/src/Plugin/views/filter/ElasticsearchViewsFulltextSearch.php, line 24

Class

ElasticsearchViewsFulltextSearch
Default implementation of the base filter plugin.

Namespace

Drupal\elasticsearch_connector_views\Plugin\views\filter

Code

public function query() {
  $fields = $this->options['fields'];
  if (!empty($this->value[0])) {
    foreach ($fields as $field) {
      $this->query->where['conditions'][$field] = $this->value[0];
    }
  }
}