Apache_Solr_Document::addField
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>
Signature
public function addField(string
$key,
mixed
$value,
[boolean
$boost = false] )
Parameters
$key
— string$value
— mixed$boost
— boolean- Use false for default boost, else cast to float that should be > 0 or will be treated as false