Skip to content

Commit c2f4001

Browse files
committed
fix comment
1 parent e85010c commit c2f4001

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

src/main/java/edu/harvard/iq/dataverse/search/IndexServiceBean.java

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -608,8 +608,10 @@ private void doIndexDataset(Dataset dataset, boolean doNormalSolrDocCleanUp) thr
608608
logger.fine("Existing file docs: " + String.join(", ", solrIdsOfDocsToDelete));
609609
if (!solrIdsOfDocsToDelete.isEmpty()) {
610610
if (!latestVersion.isDraft()) {
611-
// For draft datasets after a published version, we're not reindexing the files unless their metadata changes
612-
// Therefore, to make sure their
611+
// After publication, we need to delete old draft perm docs
612+
// For the first draft, a perm doc will exist for each file
613+
// For subsequent drafts, perm docs should only exist for new files/those with changed metadata
614+
// This code adds the ids of draft perm docs for all files - if the docs don't exist, Solr will just ignore them
613615
for (String fileDocId : solrIdsOfDocsToDelete) {
614616
if (!fileDocId.endsWith(draftSuffix)) {
615617
solrIdsOfPermissionDocsToDelete.add(fileDocId + draftSuffix + discoverabilityPermissionSuffix);

0 commit comments

Comments
 (0)