Solr copyField only when destination is absent from document

Viewed 28

When I have a copyfield directive like,

<field name="a" multiValued="false"...
<field name="b" multiValued="false"...
<copyField source="a" dest="b"...

And I send a document containing field named “b”, Solr tries to write 2 values into “b” field (one from the incoming doc and one from the copyfield) and gives error because “b” is not a multi valued field.

My document update requests sometimes contain field b, sometimes not. When they are absent I want to copy the value from "a" field.

Is it possible to activate copyField directive only when dest field is absent from the incoming document?

1 Answers
Related