You are here

function apachesolr_views_query::add_where in Apache Solr Views 7

Support for groupping.

See also

views_plugin_query_default::add_where().

File

./apachesolr_views_query.inc, line 239
Views query plugin for Apache Solr Views. Gets its data not from the database, but from a Solr server.

Class

apachesolr_views_query
@file Views query plugin for Apache Solr Views. Gets its data not from the database, but from a Solr server.

Code

function add_where($group, $field, $value = NULL, $operator = NULL) {

  // Ensure all variants of 0 are actually 0. Thus '', 0 and NULL are all
  // the default group.
  if (empty($group)) {
    $group = 0;
  }

  // Check for a group.
  if (!isset($this->where[$group])) {
    $this
      ->set_where_group('AND', $group);
  }
  $this->where[$group]['conditions'][] = array(
    'field' => $field,
    'value' => $value,
    'operator' => $operator,
  );
}