You are here

apachesolr_views_handler_filter_search.inc in Apache Solr Views 6

File

handlers/apachesolr_views_handler_filter_search.inc
View source
<?php

/**
 * Class that allows searching the site with Apache Solr through a view.
 */
class apachesolr_views_handler_filter_search extends views_handler_filter_search {
  public function query() {
    if (!empty($this->value)) {
      $this->query
        ->set_query($this->value);
    }
  }

  /**
   * Validate the options form.
   */
  function exposed_validate($form, &$form_state) {

    // Don't let Views do anything if the operator is required and nothing has
    // been supplied in the exposed form.
    if (empty($form_state['values'][$this->options['expose']['identifier']]) && $this->options['operator'] == 'required') {
      $this->view->executed = TRUE;
    }
  }

}

Classes

Namesort descending Description
apachesolr_views_handler_filter_search Class that allows searching the site with Apache Solr through a view.