You are here

public function SearchApiSolrDocument::setFieldBoost in Search API Solr 7

Sets the field boost for a document field.

Parameters

string $key: The name of the field.

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

2 calls to SearchApiSolrDocument::setFieldBoost()
SearchApiSolrDocument::addField in includes/document.inc
Adds a value to a multi-valued field
SearchApiSolrDocument::setField in includes/document.inc
Sets a field value.

File

includes/document.inc, line 260

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 setFieldBoost($key, $boost) {
  $boost = (double) $boost;
  if ($boost > 0.0) {
    $this->fieldBoosts[$key] = $boost;
  }
  else {
    $this->fieldBoosts[$key] = FALSE;
  }
}