Skip to content

Commit

Permalink
Merge 8b52741 into bee4eb4
Browse files Browse the repository at this point in the history
  • Loading branch information
jp-tosca committed Apr 10, 2024
2 parents bee4eb4 + 8b52741 commit 2e7bab6
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 3 deletions.
3 changes: 3 additions & 0 deletions doc/release-notes/10464-add-name-harvesting-client-facet.md
@@ -0,0 +1,3 @@
The Metadata Source facet has been updated to show the name of the harvesting client rather than grouping all such datasets under 'harvested'

TODO: for the v6.13 release note: Please add a full re-index using http://localhost:8080/api/admin/index to the upgrade instructions.
Expand Up @@ -897,7 +897,8 @@ public SolrInputDocuments toSolrDocs(IndexableDataset indexableDataset, Set<Long

if (dataset.isHarvested()) {
solrInputDocument.addField(SearchFields.IS_HARVESTED, true);
solrInputDocument.addField(SearchFields.METADATA_SOURCE, HARVESTED);
solrInputDocument.addField(SearchFields.METADATA_SOURCE,
dataset.getHarvestedFrom() != null ? dataset.getHarvestedFrom().getName() : HARVESTED);
} else {
solrInputDocument.addField(SearchFields.IS_HARVESTED, false);
solrInputDocument.addField(SearchFields.METADATA_SOURCE, rdvName); //rootDataverseName);
Expand Down
Expand Up @@ -15,9 +15,7 @@
import static jakarta.ws.rs.core.Response.Status.ACCEPTED;
import static jakarta.ws.rs.core.Response.Status.OK;
import static org.hamcrest.CoreMatchers.equalTo;
import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.*;
import static org.junit.jupiter.api.Assertions.assertTrue;

/**
* This class tests Harvesting Client functionality.
Expand Down Expand Up @@ -272,6 +270,12 @@ private void harvestingClientRun(boolean allowHarvestingMissingCVV) throws Inte
} while (i<maxWait);

System.out.println("Waited " + i + " seconds for the harvest to complete.");

Response searchHarvestedDatasets = UtilIT.search("metadataSource:" + nickName, normalUserAPIKey);
searchHarvestedDatasets.prettyPrint();
searchHarvestedDatasets.then().assertThat()
.statusCode(OK.getStatusCode())
.body("data.total_count", equalTo(expectedNumberOfSetsHarvested));

// Fail if it hasn't completed in maxWait seconds
assertTrue(i < maxWait);
Expand Down

0 comments on commit 2e7bab6

Please sign in to comment.