ESGF / esg-search

ESGF Search Component
http://esgf.org/esg-search/
Other
8 stars 14 forks source link

should retract set latest=true on latest non-retracted version? #140

Open alaniwi opened 4 years ago

alaniwi commented 4 years ago

I see there is code to set latest=false when retracting a dataset version:

https://github.com/ESGF/esg-search/blob/f3dbb548c45afba5ffa84a9352c3d452f5f4f650/src/java/main/esg/search/publish/impl/solr/SolrRetractor.java#L82

but if the version which is being retracted has latest=true and earlier non-retracted versions exist, then it might be helpful also to restore the latest=true on the latest non-retracted version -- so that it will be found when searching without "show all versions" -- rather than leave it without any versions of the dataset having latest=true.

If this is done, then it would also be necessary to ensure that when publishing a new later version, it would set latest=false on whichever earlier version has latest=true, not necessarily the latest existing version (which might have been retracted). I'm not sure if the existing code would need to be modified to achieve this, but see the lines following this comment: https://github.com/ESGF/esg-search/blob/f3dbb548c45afba5ffa84a9352c3d452f5f4f650/src/java/main/esg/search/publish/thredds/ThreddsCrawler.java#L224-L225

For example: