You are here

public function ApacheSolrDocument::getField in Apache Solr Search 7

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

Get field information

Parameters

string $key:

Return value

mixed associative array of info if field exists, false otherwise

File

./Apache_Solr_Document.php, line 199

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 getField($key) {
  if (isset($this->_fields[$key])) {
    return array(
      'name' => $key,
      'value' => $this->_fields[$key],
      'boost' => $this
        ->getFieldBoost($key),
    );
  }
  return FALSE;
}