Closed avdata99 closed 2 years ago
@avdata99 This Solr error means that we are trying to index a list or object field eg dataset['key'] = ['a', 'b']
or dataset['key'] = {'a', 'b'}
instead of a string (eg a JSON dump like dataset["key"] = '["a", "b"]'
). Solr 8 is less forgiving than Solr 6 so that's why we are getting this error now.
It normally is a symptom of an underlying cause. Having found it on other extensions while upgrading to 2.10 this can be caused, for instance by:
IPackageController
hooks not being calledI think removing the archiver
key entirely is a bit drastic as this is exposed via the API and users might relying on it. I would keep it as is on after_dataset_search()
but pop it from the dict on before_dataset_index()
so it doesn't mess with the indexing
Related to CKAN#6787
This PR is getting a SOLR error only for CKAN 2.10 (all other CKAN version works fine)
If I drop the
archiver
key from package before index it (something likedel(package['archiver'])
here or commenting this line)There is no problem with the
archiver
key for resources, only for the main package.The error is
Where
reason
is a field inside thearchiver
key in thepkg_dict
If I remove thereason
key from the dict, I get the same error in otherarchiver
field.The problem is only for dataset, not for resources
Is there any consideration regarding the update to SOLR 8?
Solution
Stop using the
archiver
key at the root level on packages (changed here)