You are here

public function apachesolr_views_handler_argument::query in Apache Solr Views 6

Same name and namespace in other branches
  1. 7 handlers/apachesolr_views_handler_argument.inc \apachesolr_views_handler_argument::query()

Add argument to query.

2 methods override apachesolr_views_handler_argument::query()
apachesolr_views_handler_argument_optionwidget::query in handlers/apachesolr_views_handler_argument_optionwidget.inc
Override query() and do some fancy manipulation of the argument so that it is boiled down to the actual field value instead of the nice title
apachesolr_views_handler_argument_search::query in handlers/apachesolr_views_handler_argument_search.inc
Add argument to query.

File

handlers/apachesolr_views_handler_argument.inc, line 12

Class

apachesolr_views_handler_argument
Class that allows searching the site with Apache Solr through a view.

Code

public function query() {
  if (!empty($this->options['break_phrase'])) {
    $this->value = explode(',', $this->argument);
  }
  else {
    $this->value = array(
      $this->argument,
    );
  }
  foreach ($this->value as $facet_value) {
    $this->query
      ->add_filter($this->real_field, apachesolr_views_query::escape_term($facet_value), $this->options['not']);
  }
}