public function SolrBaseQuery::getPath in Apache Solr Search 7
Same name and namespace in other branches
- 8 Solr_Base_Query.php \SolrBaseQuery::getPath()
- 6.3 Solr_Base_Query.php \SolrBaseQuery::getPath()
Returns the search path (including the search keywords).
Parameters
string $new_keywords: Optional. When set, this string overrides the query's current keywords.
Return value
string The search path.
Overrides DrupalSolrQueryInterface::getPath
File
- ./
Solr_Base_Query.php, line 665 - This class allows you to make operations on a query that will be sent to Apache Solr. methods such as adding and removing sorts, remove and replace parameters, adding and removing filters, getters and setters for various parameters and more
Class
Code
public function getPath($new_keywords = NULL) {
if (isset($new_keywords)) {
return $this->base_path . '/' . $new_keywords;
}
elseif ($this
->getParam('q')) {
return $this->base_path . '/' . $this
->getParam('q');
}
else {
// Return with empty query (the slash). The path for a facet
// becomes $this->base_path . '//facetinfo';
// We do this so we can have a consistent way of retrieving the query +
// additional parameters
return $this->base_path . '/';
}
}