You are here

protected function SearchApiSolrConnection::constructUrl in Search API Solr 7

Returns the HTTP URL for a certain servlet on the Solr server.

Parameters

$servlet: A string path to a Solr request handler.

array $params: Additional GET parameters to append to the URL.

$added_query_string: Additional query string to append to the URL.

Return value

string The complete URL.

7 calls to SearchApiSolrConnection::constructUrl()
SearchApiSolrConnection::makeServletRequest in includes/solr_connection.inc
Makes a request to a servlet (a path) that's not a standard path.
SearchApiSolrConnection::ping in includes/solr_connection.inc
Calls the /admin/ping servlet, to test the connection to the server.
SearchApiSolrConnection::search in includes/solr_connection.inc
Executes a search on the Solr server.
SearchApiSolrConnection::setLuke in includes/solr_connection.inc
Sets $this->luke with the metadata about the index from admin/luke.
SearchApiSolrConnection::setStats in includes/solr_connection.inc
Stores information about the Solr core in $this->stats.

... See full list

File

includes/solr_connection.inc, line 728

Class

SearchApiSolrConnection
Represents a Solr server resource.

Code

protected function constructUrl($servlet, array $params = array(), $added_query_string = NULL) {

  // PHP's built in http_build_query() doesn't give us the format Solr wants.
  $query_string = $this
    ->httpBuildQuery($params);
  if ($query_string) {
    $query_string = '?' . $query_string;
    if ($added_query_string) {
      $query_string = $query_string . '&' . $added_query_string;
    }
  }
  elseif ($added_query_string) {
    $query_string = '?' . $added_query_string;
  }
  return $this->base_url . $servlet . $query_string;
}