You are here

public function SearchApiSolrDocument::setField in Search API Solr 7

Sets a field value.

Multi-valued fields should be set as arrays or via the addField() function which will automatically make sure the field is an array.

Parameters

string $key: The name of the field.

string|array $value: The value to set for the field.

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

1 call to SearchApiSolrDocument::setField()
SearchApiSolrDocument::__set in includes/document.inc
Magic setter for field values.

File

includes/document.inc, line 234

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 setField($key, $value, $boost = FALSE) {
  $this->fields[$key] = $value;
  $this
    ->setFieldBoost($key, $boost);
}