\Apache_Solr_Document
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> ...
$document->title = 'Something';
echo $document->title;
...
</code>
Additionally, the field values can be iterated with foreach
<code>
foreach ($document as $fieldName => $fieldValue)
{
...
}
</code>
Synopsis
class Apache_Solr_Document
implements
IteratorAggregate
{
- // constants
- const SVN_REVISION = '$Revision$';
- const SVN_ID = '$Id$';
- // members
- protected boolean $_documentBoost = false;
- protected array $_fields = ;
- protected array $_fieldBoosts = ;
- // methods
- public void clear()
- public mixed getBoost()
- public void setBoost()
- public void addField()
- public void setMultiValue()
- public mixed getField()
- public void setField()
- public float getFieldBoost()
- public void setFieldBoost()
- public array getFieldBoosts()
- public array getFieldNames()
- public array getFieldValues()
- public void getIterator()
- public mixed __get()
- public void __set()
- public boolean __isset()
- public void __unset()
Hierarchy
Implements
Constants
Name | Value |
---|---|
SVN_REVISION | '$Revision$' |
SVN_ID | '$Id$' |
Members
protected
- $_documentBoost
—
float
Document boost value - $_fieldBoosts
—
array
Document field boost values, indexed by name - $_fields
—
array
Document field values, indexed by name
Methods
public
- __get() — Magic get for field values
- __isset() — Magic isset for fields values. Do not call directly. Allows usage:
- __set() — Magic set for field values. Multi-valued fields should be set as arrays or instead use the addField(...) function which will automatically make sure the field is an array.
- __unset() — Magic unset for field values. Do not call directly. Allows usage:
- addField() — Add a value to a multi-valued field
- clear() — Clear all boosts and fields from this document
- getBoost() — Get current document boost
- getField() — Get field information
- getFieldBoost() — Get the currently set field boost for a document field
- getFieldBoosts() — Return current field boosts, indexed by field name
- getFieldNames() — Get the names of all fields in this document
- getFieldValues() — Get the values of all fields in this document
- getIterator() — IteratorAggregate implementation function. Allows usage:
- setBoost() — Set document boost factor
- setField() — Set a field value. Multi-valued fields should be set as arrays or instead use the addField(...) function which will automatically make sure the field is an array.
- setFieldBoost() — Set the field boost for a document field
- setMultiValue() — Handle the array manipulation for a multi-valued field