The SolrDocument class

Introduction

Represents a Solr document retrieved from a query response.

Class synopsis

SolrDocument
final class SolrDocument implements ArrayAccess, Iterator, Serializable {
/* Constants */
const int SolrDocument::SORT_DEFAULT = 1;
const int SolrDocument::SORT_ASC = 1;
const int SolrDocument::SORT_DESC = 2;
const int SolrDocument::SORT_FIELD_NAME = 1;
const int SolrDocument::SORT_FIELD_VALUE_COUNT = 2;
const int SolrDocument::SORT_FIELD_BOOST_VALUE = 4;
/* Methods */
public __construct()
public bool addField(string $fieldName, string $fieldValue)
public bool clear()
public void __clone()
public SolrDocumentField current()
public bool deleteField(string $fieldName)
public bool fieldExists(string $fieldName)
public SolrDocumentField __get(string $fieldName)
public array getChildDocuments()
public int getChildDocumentsCount()
public SolrDocumentField getField(string $fieldName)
public int getFieldCount()
public array getFieldNames()
public SolrInputDocument getInputDocument()
public bool hasChildDocuments()
public bool __isset(string $fieldName)
public string key()
public bool merge(SolrDocument $sourceDoc, bool $overwrite = true)
public void next()
public bool offsetExists(string $fieldName)
public SolrDocumentField offsetGet(string $fieldName)
public void offsetSet(string $fieldName, string $fieldValue)
public void offsetUnset(string $fieldName)
public bool reset()
public void rewind()
public string serialize()
public bool __set(string $fieldName, string $fieldValue)
public bool sort(int $sortOrderBy, int $sortDirection = SolrDocument::SORT_ASC)
public array toArray()
public void unserialize(string $serialized)
public bool __unset(string $fieldName)
public bool valid()
public __destruct()
}

Predefined Constants

SolrDocument::SORT_DEFAULT

Default mode for sorting fields within the document.

SolrDocument::SORT_ASC

Sorts the fields in ascending order

SolrDocument::SORT_DESC

Sorts the fields in descending order

SolrDocument::SORT_FIELD_NAME

Sorts the fields by field name.

SolrDocument::SORT_FIELD_VALUE_COUNT

Sorts the fields by number of values in each field.

SolrDocument::SORT_FIELD_BOOST_VALUE

Sorts the fields by thier boost values.

Table of Contents