function elasticsearch_connector_views_handler_filter_string_autocomplete::op_word in Elasticsearch Connector 7.5
Same name and namespace in other branches
- 7 modules/elasticsearch_connector_views/handlers/elasticsearch_connector_views_handler_filter_string_autocomplete.inc \elasticsearch_connector_views_handler_filter_string_autocomplete::op_word()
- 7.2 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,
),
),
),
));
}