You are here

public function SearchApiSolrDocument::setBoost in Search API Solr 7

Sets the document boost factor.

Parameters

float|false $boost: FALSE for default boost, or a positive number for setting a document boost.

File

includes/document.inc, line 142

Class

SearchApiSolrDocument
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;
  }
}