Solr index still keep the obsoletedBy field even though it was removed from the system metadata and reindexed
Chris reported the issue:
we’re trying to reindex a pid in Metacat, and can’t seem to get it to drop the `obsoletedBy` attr. I changed the system metadata in hazelcast to remove that field (and confirmed it in postgres). After logging in and issuing `action=reindex&pid=urn:uuid:f22d78a2-719a-4704-856b-cc02fa803290`, I see the reindex happen in catalina.out. But then when checking it, `obsoletedBy` is still there. Do we have a way to remove the entry from Solr and start from scratch?
or is there a setting in the indexer that’s just merging, and not deleting attrs?
this is on arcticdata.io
#2 Updated by Jing Tao over 3 years ago
I tried to use curl command to call the updateSystemmetadata to remove the "obsoletedBy" field. But I got the error:
<error detailCode="4869" errorCode="400" name="InvalidRequest">
<description>The request is trying to reset the obsoletedBy field in the system metadata of the object jing-tao.15.1. This is illegal since the obsoletedBy filed is set, you can't change it again.</description>
Seems we can't remove it regularly. I have to write a hazelcast client class to do it ( it is a hack!)
#3 Updated by Jing Tao about 3 years ago
- Status changed from New to Resolved
It turns out that our solr index merge mechanism had an issue. It always copied the fields from the existing solr doc in the solr server to overwrite our new generated solr doc. In this case, the new generated doc doesn't have this obsoletedBy field, but the existing solr doc did have one. So it copied the the existing one to the new one.
Our solution is: for the system metadata fields, we don't merge it.
It works great.