-
Notifications
You must be signed in to change notification settings - Fork 500
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: correctly set "multiValued" property in Solr schema for deeply nested fields #11136
fix: correctly set "multiValued" property in Solr schema for deeply nested fields #11136
Conversation
Before switching to this branch, I'm just adding a some detail of the errors one sees on the develop branch when trying to create a dataset using the JSON and TSV above:
Also, I don't think this will surprise anyone, but the JSF UI does not support deeply nested fields. It's completely out of scope to fix this in JSF. It looks like this when you click "create dataset": |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Works great. I added a release note. Approved.
Here are the fields that were added when I updated the Solr schema:
328a329,331
> <field name="identifier2" type="text_en" multiValued="true" stored="true" indexed="true"/>
> <field name="identifier_text2" type="text_en" multiValued="true" stored="true" indexed="true"/>
> <field name="identifier_type2" type="text_en" multiValued="true" stored="true" indexed="true"/>
349a353
> <field name="person2" type="text_en" multiValued="true" stored="true" indexed="true"/>
570a575,577
> <copyField source="identifier2" dest="_text_" maxChars="3000"/>
> <copyField source="identifier_text2" dest="_text_" maxChars="3000"/>
> <copyField source="identifier_type2" dest="_text_" maxChars="3000"/>
591a599
> <copyField source="person2" dest="_text_" maxChars="3000"/>
I also made this related PR:
PR looking great. I followed the testing steps and did further regression testing. No issues found. Release snippet looks good as well. Server log attached |
What this PR does / why we need it:
This PR fixes a bug in the
/api/admin/index/solr/schema
endpoint reported in #9200. ThemultiValued
property was not set correctly for some deeply nested metadata fields, causing indexing errors:org.apache.solr.common.SolrException: ERROR: [doc=dataset_1479] multiple values encountered for non multiValued field
This is because the code only checked for whether the direct parent of a metadata field is multi-valued to see whether a child metadata field must be declared as multi-valued in the Solr schema. However, all ancestor fields (parents, grandparents, etc.) need to be checked. This PR updates the code to handle deeper metadata nesting properly.
Which issue(s) this PR closes:
This is related to #9200, but doesn't close the issue, because it also describes UI issues related to deeply nested fields, but it's a fix of the Solr schema bug described there.
Special notes for your reviewer:
/
Suggestions on how to test this:
/api/admin/index/solr/schema
to update Solr'sschema.xml
(see https://guides.dataverse.org/en/latest/admin/metadatacustomization.html#updating-the-solr-schema)
Does this PR introduce a user interface change? If mockups are available, please link/include them here:
/
Is there a release notes update needed for this change?:
/
Additional documentation:
/