public function addField($key, $value, $boost = false)
	{
		if (!isset($this->_fields[$key]))
		{
			// create holding array if this is the first value
			$this->_fields[$key] = array();
		}
		else if (!is_array($this->_fields[$key]))
		{
			// move existing value into array if it is not already an array
			$this->_fields[$key] = array($this->_fields[$key]);
		}

		if ($this->getFieldBoost($key) === false)
		{
			// boost not already set, set it now
			$this->setFieldBoost($key, $boost);
		}
		else if ((float) $boost > 0.0)
		{
			// multiply passed boost with current field boost - similar to SolrJ implementation
			$this->_fieldBoosts[$key] *= (float) $boost;
		}

		// add value to array
		$this->_fields[$key][] = $value;
	}
public function addField($key, $value, $boost = false)
	{
		if (!isset($this->_fields[$key]))
		{
			// create holding array if this is the first value
			$this->_fields[$key] = array();
		}
		else if (!is_array($this->_fields[$key]))
		{
			// move existing value into array if it is not already an array
			$this->_fields[$key] = array($this->_fields[$key]);
		}

		if ($this->getFieldBoost($key) === false)
		{
			// boost not already set, set it now
			$this->setFieldBoost($key, $boost);
		}
		else if ((float) $boost > 0.0)
		{
			// multiply passed boost with current field boost - similar to SolrJ implementation
			$this->_fieldBoosts[$key] *= (float) $boost;
		}

		// add value to array
		$this->_fields[$key][] = $value;
	}
public function addField ( $ key , $ value , $ boost = false ) { if ( ! isset ( $ this -> _fields [ $ key ] ) ) { // create holding array if this is the first value $ this -> _fields [ $ key ] = array ( ) ; } else if ( ! is_array ( $ this -> _fields [ $ key ] ) ) { // move existing value into array if it is not already an array $ this -> _fields [ $ key ] = array ( $ this -> _fields [ $ key ] ) ; } if ( $ this -> getFieldBoost ( $ key ) === false ) { // boost not already set, set it now $ this -> setFieldBoost ( $ key , $ boost ) ; } else if ( ( float ) $ boost > 0.0 ) { // multiply passed boost with current field boost - similar to SolrJ implementation $ this -> _fieldBoosts [ $ key ] *= ( float ) $ boost ; } // add value to array $ this -> _fields [ $ key ] [ ] = $ value ; }
Add a value to a multi-valued field

NOTE: the solr XML format allows you to specify boosts
PER value even though the underlying Lucene implementation
only allows a boost per field. To remedy this, the final
field boost value will be the product of all specified boosts
on field values - this is similar to SolrJ's functionality.

<code>
$doc = new Apache_Solr_Document();

$doc->addField('foo', 'bar', 2.0);
$doc->addField('foo', 'baz', 3.0);

// resultant field boost will be 6!
echo $doc->getFieldBoost('foo');
</code>

@param string $key
@param mixed $value
@param mixed $boost Use false for default boost, else cast to float that should be > 0 or will be treated as false
Add a value to a multi - valued field