You are here

public function SolrBaseQuery::getSolrParams in Apache Solr Search 7

Same name and namespace in other branches
  1. 8 Solr_Base_Query.php \SolrBaseQuery::getSolrParams()
  2. 6.3 Solr_Base_Query.php \SolrBaseQuery::getSolrParams()

Gets parameters in a form suitable for use in a Solr query.

Return value

array All parameters as key-value pairs, where values have been transformed into Solr parameter values.

Overrides DrupalSolrQueryInterface::getSolrParams

1 call to SolrBaseQuery::getSolrParams()
SolrBaseQuery::search in ./Solr_Base_Query.php
Sends the search request to Solr, unless $query->abort_search is TRUE.

File

./Solr_Base_Query.php, line 462
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

SolrBaseQuery

Code

public function getSolrParams() {
  $params = $this
    ->getParams();

  // For certain fields Solr prefers a comma separated list.
  foreach (array(
    'fl',
    'hl.fl',
    'sort',
    'mlt.fl',
  ) as $name) {
    if (isset($params[$name])) {
      $params[$name] = implode(',', $params[$name]);
    }
  }
  return $params;
}