You are here

public function ApacheSolrFacetapiAdapter::getSearchPath in Apache Solr Search 7

Same name and namespace in other branches
  1. 8 plugins/facetapi/adapter.inc \ApacheSolrFacetapiAdapter::getSearchPath()
  2. 6.3 plugins/facetapi/adapter.inc \ApacheSolrFacetapiAdapter::getSearchPath()

Returns the search path.

@todo D8 should provide an API function for this.

Return value

string A string containing the search path.

File

plugins/facetapi/adapter.inc, line 108
Classes used by the Facet API module.

Class

ApacheSolrFacetapiAdapter
Facet API adapter for the Apache Solr Search Integration module.

Code

public function getSearchPath() {
  $env_id = $this->info['instance'];
  $query = apachesolr_current_query($env_id);
  if (!$query || NULL === $this->searchPath && NULL === $query
    ->getPath()) {
    if ($path = module_invoke($this->info['module'] . '_search', 'search_info')) {
      $this->searchPath = 'search/' . $path['path'];
      if (!isset($_GET['keys']) && ($keys = $this
        ->getSearchKeys())) {
        $this->searchPath .= '/' . $keys;
      }
    }
  }
  if (!$query || NULL === $query
    ->getPath()) {
    return $this->searchPath;
  }
  else {
    return $query
      ->getPath();
  }
}