You are here

public function ApacheSolrDocument::setBoost in Apache Solr Search 7

Same name and namespace in other branches
  1. 8 Apache_Solr_Document.php \ApacheSolrDocument::setBoost()
  2. 6.3 Apache_Solr_Document.php \ApacheSolrDocument::setBoost()

Set document boost factor

Parameters

mixed $boost: Use false for default boost, else cast to float that should be > 0 or will be treated as false

File

./Apache_Solr_Document.php, line 124

Class

ApacheSolrDocument
Holds Key / Value pairs that represent a Solr Document along with any associated boost values. Field values can be accessed by direct dereferencing such as:

Code

public function setBoost($boost) {
  $boost = (double) $boost;
  if ($boost > 0.0) {
    $this->_documentBoost = $boost;
  }
  else {
    $this->_documentBoost = FALSE;
  }
}