SolrDocument
final class SolrDocument implements ArrayAccess, Iterator, Serializable (View source)
(PECL solr >= 0.9.2)
Class SolrDocument
This class represents a Solr document retrieved from a query response.
Constants
SORT_DEFAULT |
|
SORT_ASC |
|
SORT_DESC |
|
SORT_FIELD_NAME |
|
SORT_FIELD_VALUE_COUNT |
|
SORT_FIELD_BOOST_VALUE |
|
Methods
(PECL solr >= 0.9.2)
Adds a field to the document
(PECL solr >= 0.9.2)
Drops all the fields in the document
(PECL solr >= 0.9.2)
Creates a copy of a SolrDocument object
(PECL solr >= 0.9.2)
SolrDocument constructor.
(PECL solr >= 0.9.2)
Retrieves the current field
(PECL solr >= 0.9.2)
Removes a field from the document
(PECL solr >= 0.9.2)
Destructor
(PECL solr >= 0.9.2)
Checks if a field exists in the document
(PECL solr >= 0.9.2)
Access the field as a property
(PECL solr >= 2.3.0)
Returns an array of child documents (SolrInputDocument)
(PECL solr >= 2.3.0)
Returns the number of child documents
(PECL solr >= 0.9.2)
Retrieves a field by name
(PECL solr >= 0.9.2)
Returns the number of fields in this document
(PECL solr >= 0.9.2)
Returns an array containing all the fields in the document
(PECL solr >= 0.9.2)
Returns a SolrInputDocument equivalent of the object
(PECL solr >= 2.3.0)
Checks whether the document has any child documents
(PECL solr >= 0.9.2)
Checks if a field exists
(PECL solr >= 0.9.2)
Retrieves the current key
(PECL solr >= 0.9.2)
Merges one input document into another
(PECL solr >= 0.9.2)
Moves the internal pointer to the next field
(PECL solr >= 0.9.2)
Checks if a particular field exists
(PECL solr >= 0.9.2)
Retrieves a field
(PECL solr >= 0.9.2)
Adds a field to the document
(PECL solr >= 0.9.2)
Removes a field
(PECL solr >= 0.9.2)
This is an alias of SolrDocument::clear
(PECL solr >= 0.9.2)
Resets the internal pointer to the beginning
(PECL solr >= 0.9.2)
Used for custom serialization
(PECL solr >= 0.9.2)
Adds another field to the document
(PECL solr >= 0.9.2)
Sorts the fields within the document
(PECL solr >= 0.9.2)
Returns an array representation of the document
(PECL solr >= 0.9.2)
Custom serialization of SolrDocument objects
(PECL solr >= 0.9.2)
Removes a field from the document
(PECL solr >= 0.9.2)
Checks if the current position internally is still valid
Details
bool
addField(string $fieldName, string $fieldValue)
(PECL solr >= 0.9.2)
Adds a field to the document
bool
clear()
(PECL solr >= 0.9.2)
Drops all the fields in the document
__clone()
(PECL solr >= 0.9.2)
Creates a copy of a SolrDocument object
__construct()
(PECL solr >= 0.9.2)
SolrDocument constructor.
mixed
current()
(PECL solr >= 0.9.2)
Retrieves the current field
bool
deleteField(string $fieldName)
(PECL solr >= 0.9.2)
Removes a field from the document
__destruct()
(PECL solr >= 0.9.2)
Destructor
bool
fieldExists(string $fieldName)
(PECL solr >= 0.9.2)
Checks if a field exists in the document
SolrDocumentField
__get(string $fieldName)
(PECL solr >= 0.9.2)
Access the field as a property
SolrInputDocument[]
getChildDocuments()
(PECL solr >= 2.3.0)
Returns an array of child documents (SolrInputDocument)
int
getChildDocumentsCount()
(PECL solr >= 2.3.0)
Returns the number of child documents
SolrDocumentField|false
getField(string $fieldName)
(PECL solr >= 0.9.2)
Retrieves a field by name
int|false
getFieldCount()
(PECL solr >= 0.9.2)
Returns the number of fields in this document
array|false
getFieldNames()
(PECL solr >= 0.9.2)
Returns an array containing all the fields in the document
SolrInputDocument
getInputDocument()
(PECL solr >= 0.9.2)
Returns a SolrInputDocument equivalent of the object
bool
hasChildDocuments()
(PECL solr >= 2.3.0)
Checks whether the document has any child documents
bool
__isset(string $fieldName)
(PECL solr >= 0.9.2)
Checks if a field exists
mixed
key()
(PECL solr >= 0.9.2)
Retrieves the current key
bool
merge(SolrInputDocument $sourceDoc, bool $overwrite = true)
(PECL solr >= 0.9.2)
Merges one input document into another
void
next()
(PECL solr >= 0.9.2)
Moves the internal pointer to the next field
bool
offsetExists(string $fieldName)
(PECL solr >= 0.9.2)
Checks if a particular field exists
mixed
offsetGet(string $fieldName)
(PECL solr >= 0.9.2)
Retrieves a field
void
offsetSet(string $fieldName, string $fieldValue)
(PECL solr >= 0.9.2)
Adds a field to the document
void
offsetUnset(string $fieldName)
(PECL solr >= 0.9.2)
Removes a field
bool
reset()
(PECL solr >= 0.9.2)
This is an alias of SolrDocument::clear
void
rewind()
(PECL solr >= 0.9.2)
Resets the internal pointer to the beginning
string|null
serialize()
(PECL solr >= 0.9.2)
Used for custom serialization
bool
__set(string $fieldName, string $fieldValue)
(PECL solr >= 0.9.2)
Adds another field to the document
bool
sort(int $sortOrderBy, int $sortDirection = SolrInputDocument::SORT_ASC)
(PECL solr >= 0.9.2)
Sorts the fields within the document
array
toArray()
(PECL solr >= 0.9.2)
Returns an array representation of the document
void
unserialize(string $serialized)
(PECL solr >= 0.9.2)
Custom serialization of SolrDocument objects
bool
__unset(string $fieldName)
(PECL solr >= 0.9.2)
Removes a field from the document
bool
valid()
(PECL solr >= 0.9.2)
Checks if the current position internally is still valid