'Update Request Processors fails on MaxFieldValueUpdateProcessorFactory when updating document
I have a schema with two fields: a multivalued multi_l and a singlevalued max_l. The max_l field should contain the maximum value of multi_l.
To accomplish this I have a updateRequestProcessorChain defined and when adding new documents this works fine, but when I try to (partially) update a document I get a multiple values encountered for non multiValued field error.
The updateRequestProcessorChain in solrconfig.xml:
<updateRequestProcessorChain name="min_max" default="true">
<processor class="solr.CloneFieldUpdateProcessorFactory">
<str name="source">multi_l</str>
<str name="dest">max_l</str>
</processor>
<processor class="solr.MaxFieldValueUpdateProcessorFactory">
<str name="fieldName">max_l</str>
</processor>
<processor class="solr.LogUpdateProcessorFactory" />
<processor class="solr.RunUpdateProcessorFactory" />
</updateRequestProcessorChain>
The fields in schema.xml:
<field name="multi_l" type="long" docValues="true" multiValued="true" indexed="true" stored="true"/>
<field name="max_l" type="long" docValues="true" multiValued="false" indexed="true" stored="true"/>
Adding a new document works:
{
"add": {
"doc": {
"id": "4",
"multi_l": [ 42, 33 ]
}
}
}
Updating fails:
{
"id":"4",
"multi_l":{"add":99},
}
I think it has something to do with this:
If the resolved dest field already exists in the document, then the values from the source fields will be added to it
Does anybody know how to fix this?
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
