How would I go about adding multiple values to a multiValued field using the php solr extension?
You would simply iterate the array (multiValued),
and run addField once for each of the array value.
foreach (array('Justin', 'Sean') as $coder)
{
$doc->addField('coder', $coder);
}
Add a multivalued field in your solr instance, and restart it.
<?php
$multi_values = array("val-1", "val-2", "val-3");
foreach ($multi_values as $i => $value) {
$SolrInputDocument->addField("field_name", $value, $i);
}
view php docs here
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With