Upgrading a schema for Solr 7.7.3, originally functional in Solr 5.5.4.
For a field defined like this:
<field name="my_field" type="string" indexed="true" stored="true" multiValued="true" />
Solr is handed a dict from a Python web app containing values that are originally a csv-style string from a form textbox:
"Magic Value, Visual-C PlusPlus, ABC123"
I split the string on the commas (and trim whitespace). Then Solr receives the values for my_field as an array.
This worked in Solr 5.5.4. Solr 7.7.3 complains about the field while rebuilding its index, with:
"multiple values encountered for non multiValued field my_field: [Magic Value, Visual-C PlusPlus, ABC123]"
I implemented the above array fix to satisfy this error in the first place. Why is it breaking again with the version change? What does Solr expect?
The only thing I can guess given most documentation of multiValued, or given most answers to the above error, is that Solr seems to expect actual multiple items with the same name as my_field (which I can't do from a Python dict).
Fundamentally, the problem was the shift towards managed-schema by default in newer versions of Solr.
I finally figured out that Solr was not using the schema.xml file I was updating. It was sticking to the managed-schema file it had already created, in the .../myCore/conf directory. Deleting managed-schema made Solr re-create it, and then led to pointing out all sorts of other updates needed in the .../myCore/conf files, such as solrconfig.xml, once I tried re-indexing. (Also, to note, I couldn't tell that Solr moves schema.xml to schema.xml.bak after creating managed-schema, because managed-schema already existed, and we also have a deployment script that turns schema.xml into a link to its location in a config directory where our repo gets deployed.)
So, watch for necessary updates to the core configuration files, and any changes towards using managed schema.