You are here

public function SolrBaseQuery::replaceParam in Apache Solr Search 7

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

Replaces a param to be sent when running the Solr search.

Basically a shortcut for removeParam() plus addParam().

Parameters

string $name: A Solr param name, e.g. 'q' or 'fl'.

$value: A Solr param value: an array of values, or a string for a single value.

Return value

DrupalSolrQueryInterface The called object.

Overrides DrupalSolrQueryInterface::replaceParam

File

./Solr_Base_Query.php, line 567
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 replaceParam($name, $value) {
  $this
    ->removeParam($name);
  return $this
    ->addParam($name, $value);
}