You are here

public function FacetapiAdapter::getSearchPath in Facet API 7.2

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

Returns the search path associated with this searcher.

@todo D8 should provide an API function for this.

Return value

string A string containing the search path.

1 method overrides FacetapiAdapter::getSearchPath()
FacetapiTestAdapter::getSearchPath in tests/facetapi_test.plugins.inc
Overrides FacetapiAdapter::getSearchPath().

File

plugins/facetapi/adapter.inc, line 514
Adapter plugin and adapter related classes.

Class

FacetapiAdapter
Abstract class extended by Facet API adapters.

Code

public function getSearchPath() {
  if (NULL === $this->searchPath) {

    // Backwards compatibility with apachesolr <= beta8.
    // @see http://drupal.org/node/1305748#comment-5102352
    foreach (array(
      $this->info['module'],
      $this->info['module'] . '_search',
    ) as $module) {
      if ($path = module_invoke($module, 'search_info')) {
        $this->searchPath = 'search/' . $path['path'];
        if (!isset($_GET['keys']) && ($keys = $this
          ->getSearchKeys())) {
          $this->searchPath .= '/' . $keys;
        }
        break;
      }
    }
  }
  return $this->searchPath;
}