You are here

class ApachesolrViewsSolrBaseQuery in Apache Solr Views 7

@file Contains custom SolrBaseQuery class for Apachesolr Views.

Hierarchy

Expanded class hierarchy of ApachesolrViewsSolrBaseQuery

File

./apachesolr_views_solr_base_query.inc, line 8
Contains custom SolrBaseQuery class for Apachesolr Views.

View source
class ApachesolrViewsSolrBaseQuery extends SolrBaseQuery {

  // The view related with this query object.
  protected $view;

  /**
   * Constructs a new archiver instance.
   *
   * @param string $name
   *   The search name, used for finding the correct blocks and other config.
   *   Typically "apachesolr".
   *
   * @param string $solr
   *   An instantiated DrupalApacheSolrService Object.
   *   Can be instantiated from apachesolr_get_solr().
   *
   * @param array $params
   *   Array of params to initialize the object (typically 'q' and 'fq').
   *
   * @param string $sortstring
   *   Visible string telling solr how to sort - added to GET query params.
   *
   * @param string $base_path
   *   The search base path (without the keywords) for this query,
   *   without trailing slash.
   *
   * @param array $context
   *   The context related with this query.
   *
   * @param object $view
   *   The view object related with this query.
   */
  public function __construct($name, $solr, array $params = array(), $sortstring = '', $base_path = '', $context = array(), $view = NULL) {
    parent::__construct($name, $solr, $params, $sortstring, $base_path, $context);
    $this->view = $view;
  }

  /**
   * Need to set proper base path for facets.
   */
  public function getPath($new_keywords = NULL) {
    if (isset($new_keywords)) {
      return $this->base_path . '/' . $new_keywords;
    }
    return $this->base_path;
  }

  /**
   * Returns the view related with this query object.
   */
  public function getView() {
    return $this->view;
  }

  /**
   * Override method, so views sorts do not become overriden randomly.
   */
  protected function parseSortString() {

    // Do nothing.
  }

}

Members

Namesort descending Modifiers Type Description Overrides
ApachesolrViewsSolrBaseQuery::$view protected property
ApachesolrViewsSolrBaseQuery::getPath public function Need to set proper base path for facets. Overrides SolrBaseQuery::getPath
ApachesolrViewsSolrBaseQuery::getView public function Returns the view related with this query object.
ApachesolrViewsSolrBaseQuery::parseSortString protected function Override method, so views sorts do not become overriden randomly. Overrides SolrBaseQuery::parseSortString
ApachesolrViewsSolrBaseQuery::__construct public function Constructs a new archiver instance. Overrides SolrBaseQuery::__construct
SolrBaseQuery::$abort_search public property
SolrBaseQuery::$available_sorts protected property
SolrBaseQuery::$base_path protected property The search base path.
SolrBaseQuery::$context protected property
SolrBaseQuery::$field_map protected property
SolrBaseQuery::$name protected property The query name is used to construct a searcher string. Mostly the environment id
SolrBaseQuery::$page public property
SolrBaseQuery::$params protected property The parameters that get sent to Solr.
SolrBaseQuery::$solr protected property DrupalApacheSolrService object
SolrBaseQuery::$solrsort protected property
SolrBaseQuery::addContext public function Set context value. Overrides DrupalSolrQueryInterface::addContext
SolrBaseQuery::addFieldAliases public function Handles aliases for field to make nicer URLs. Overrides DrupalSolrQueryInterface::addFieldAliases
SolrBaseQuery::addFq protected function
SolrBaseQuery::addParam public function Adds a param to be sent when running the Solr search. Overrides DrupalSolrQueryInterface::addParam
SolrBaseQuery::addParams public function Adds multiple params to be sent when running the Solr search. Overrides DrupalSolrQueryInterface::addParams
SolrBaseQuery::clearFieldAliases public function Overrides DrupalSolrQueryInterface::clearFieldAliases
SolrBaseQuery::defaultSorts protected function
SolrBaseQuery::getAvailableSorts public function Overrides DrupalSolrQueryInterface::getAvailableSorts
SolrBaseQuery::getContext public function Get context values. Overrides DrupalSolrQueryInterface::getContext
SolrBaseQuery::getFieldAliases public function Overrides DrupalSolrQueryInterface::getFieldAliases
SolrBaseQuery::getName public function Get query name. Overrides DrupalSolrQueryInterface::getName
SolrBaseQuery::getParam public function Gets the value of a parameter. Overrides DrupalSolrQueryInterface::getParam
SolrBaseQuery::getParams public function Gets all parameters in normalized form. Overrides DrupalSolrQueryInterface::getParams
SolrBaseQuery::getSearcher public function Get query searcher name (for facetapi, views, pages, etc). Overrides DrupalSolrQueryInterface::getSearcher
SolrBaseQuery::getSingleValueParams protected function Get Single Value params for the base query.
SolrBaseQuery::getSolrParams public function Gets parameters in a form suitable for use in a Solr query. Overrides DrupalSolrQueryInterface::getSolrParams
SolrBaseQuery::getSolrsort public function Gets the current sort. Overrides DrupalSolrQueryInterface::getSolrsort
SolrBaseQuery::getSolrsortUrlQuery public function Returns an array representing the URL query string for the current sort. Overrides DrupalSolrQueryInterface::getSolrsortUrlQuery
SolrBaseQuery::getSolrVersion public function Get solr version of the query. Overrides DrupalSolrQueryInterface::getSolrVersion
SolrBaseQuery::normalizeParamValue protected function
SolrBaseQuery::removeAvailableSort public function Removes an available sort. Overrides DrupalSolrQueryInterface::removeAvailableSort
SolrBaseQuery::removeParam public function Removes all values for one Solr param. Overrides DrupalSolrQueryInterface::removeParam
SolrBaseQuery::replaceParam public function Replaces a param to be sent when running the Solr search. Overrides DrupalSolrQueryInterface::replaceParam
SolrBaseQuery::search public function Sends the search request to Solr, unless $query->abort_search is TRUE. Overrides DrupalSolrQueryInterface::search
SolrBaseQuery::setAvailableSort public function Adds an available sort. Overrides DrupalSolrQueryInterface::setAvailableSort
SolrBaseQuery::setAvailableSorts public function
SolrBaseQuery::setSolrsort public function Sets the sort. Overrides DrupalSolrQueryInterface::setSolrsort
SolrBaseQuery::solr public function Calls a method, without arguments, on the Solr object with which the query object was initialized. Overrides DrupalSolrQueryInterface::solr
SolrFilterSubQuery::$exclude public property
SolrFilterSubQuery::$fields protected property A keyed array where the key is a position integer and the value is an array with #name and #value properties. Each value is a used for filter queries, e.g. array('#name' => 'is_uid', '#value' => 0) for anonymous…
SolrFilterSubQuery::$id public property Each query/subquery will have a unique ID.
SolrFilterSubQuery::$idCount protected static property Static shared by all instances, used to increment ID numbers.
SolrFilterSubQuery::$operator public property
SolrFilterSubQuery::$subqueries protected property An array of subqueries.
SolrFilterSubQuery::addFilter public function
SolrFilterSubQuery::addFilterSubQuery public function
SolrFilterSubQuery::getFilters public function
SolrFilterSubQuery::getFilterSubQueries public function
SolrFilterSubQuery::hasFilter public function
SolrFilterSubQuery::makeFilterQuery public function
SolrFilterSubQuery::rebuildFq protected function Builds a set of filter queries from $this->fields and all subqueries.
SolrFilterSubQuery::removeFilter public function
SolrFilterSubQuery::removeFilterSubQueries public function
SolrFilterSubQuery::removeFilterSubQuery public function
SolrFilterSubQuery::unsetFilter protected function
SolrFilterSubQuery::validFilterValue public static function Make sure our query matches the pattern name:value or name:"value" Make sure that if we are ranges we use name:[ AND ] allowed inputs : a. bundle:article b. date:[1970-12-31T23:59:59Z TO NOW] Split the text in 4 different parts 1. name, eg.:…
SolrFilterSubQuery::__clone function