From dd28cb85f549062bfd0ebb20a720b56b402dd5ce Mon Sep 17 00:00:00 2001 From: utas-raymondng Date: Thu, 3 Oct 2024 14:22:58 +1000 Subject: [PATCH] Reduce weight based on comments --- .../java/au/org/aodn/esindexer/service/RankingServiceImpl.java | 3 ++- indexer/src/test/resources/canned/sample6_stac.json | 2 +- indexer/src/test/resources/canned/sample7_stac.json | 2 +- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/indexer/src/main/java/au/org/aodn/esindexer/service/RankingServiceImpl.java b/indexer/src/main/java/au/org/aodn/esindexer/service/RankingServiceImpl.java index 315012ff..df840df3 100644 --- a/indexer/src/main/java/au/org/aodn/esindexer/service/RankingServiceImpl.java +++ b/indexer/src/main/java/au/org/aodn/esindexer/service/RankingServiceImpl.java @@ -90,7 +90,8 @@ public Integer evaluateCompleteness(StacCollectionModel stacCollectionModel) { // Abstract if (stacCollectionModel.getDescription() != null && !stacCollectionModel.getDescription().isBlank()) { log.debug("Description found"); - total += (int) (stacCollectionModel.getDescription().length() * descriptionWeigth); + int w = (int) (stacCollectionModel.getDescription().length() * descriptionWeigth); + total += Math.min(w, 25); } // Links if (stacCollectionModel.getLinks() != null && !stacCollectionModel.getLinks().isEmpty()) { diff --git a/indexer/src/test/resources/canned/sample6_stac.json b/indexer/src/test/resources/canned/sample6_stac.json index f2bd01b2..ad27ff03 100644 --- a/indexer/src/test/resources/canned/sample6_stac.json +++ b/indexer/src/test/resources/canned/sample6_stac.json @@ -28,7 +28,7 @@ ] }, "summaries": { - "score": 107, + "score": 100, "status": "completed", "credits": [ "Data collected on the Marine National Facility (MNF) RV Investigator voyage IN2024_V01.", diff --git a/indexer/src/test/resources/canned/sample7_stac.json b/indexer/src/test/resources/canned/sample7_stac.json index f1815d0b..347b2cf4 100644 --- a/indexer/src/test/resources/canned/sample7_stac.json +++ b/indexer/src/test/resources/canned/sample7_stac.json @@ -6,7 +6,7 @@ "temporal" : [ [ "2021-09-30T14:00:00Z", "2022-12-31T12:59:59Z" ], [ "2021-09-30T14:00:00Z", "2022-12-31T12:59:59Z" ] ] }, "summaries" : { - "score" : 71, + "score" : 70, "status" : "completed", "credits" : [ "This data was collected by the 'Field integrated testing project' of EcoRRAP. We thank all team members, students, and volunteers for their efforts.", "The Reef Restoration and Adaptation Program is funded by the partnership between the Australian Government’s Reef Trust and the Great Barrier Reef Foundation." ], "scope" : {