I’m in a position in which I need to write a Solr DataImportHandler ScriptTransformer which will add an initial or additional value to a multivalued field.
Currently I’m attempting to use the row.put('fieldname', value) method, but it appears that the last value added is overriding the existing value rather than appending a new value.
What method or syntax is needed to add new values to a multivalued field via a ScriptTransformer?
I overlooked an example on the Solr DataImportHandler ScriptTransformer section.
It looks like you need to treat the value of the multi-valued field as an instance of the
java.util.ArrayListtype.Here’s the relevant portion of hte example, which I’ve tested and works great!