From 7d57129923539e328e87e3310d817763205ee5d7 Mon Sep 17 00:00:00 2001 From: amvanbaren Date: Mon, 30 Sep 2024 17:25:53 +0300 Subject: [PATCH] Remove deprecated search configuration properties --- .../openvsx/search/ElasticSearchService.java | 9 ------ .../openvsx/search/RelevanceService.java | 30 ------------------- 2 files changed, 39 deletions(-) diff --git a/server/src/main/java/org/eclipse/openvsx/search/ElasticSearchService.java b/server/src/main/java/org/eclipse/openvsx/search/ElasticSearchService.java index e5ab04490..e30af755b 100644 --- a/server/src/main/java/org/eclipse/openvsx/search/ElasticSearchService.java +++ b/server/src/main/java/org/eclipse/openvsx/search/ElasticSearchService.java @@ -64,15 +64,6 @@ public class ElasticSearchService implements ISearchService { @Value("${ovsx.elasticsearch.clear-on-start:false}") boolean clearOnStart; - @Value("${ovsx.elasticsearch.relevance.rating:1.0}") - double ratingRelevance; - @Value("${ovsx.elasticsearch.relevance.downloads:1.0}") - double downloadsRelevance; - @Value("${ovsx.elasticsearch.relevance.timestamp:1.0}") - double timestampRelevance; - @Value("${ovsx.elasticsearch.relevance.unverified:0.5}") - double unverifiedRelevance; - private Long maxResultWindow; public ElasticSearchService( diff --git a/server/src/main/java/org/eclipse/openvsx/search/RelevanceService.java b/server/src/main/java/org/eclipse/openvsx/search/RelevanceService.java index 46508337f..bcb99cfca 100644 --- a/server/src/main/java/org/eclipse/openvsx/search/RelevanceService.java +++ b/server/src/main/java/org/eclipse/openvsx/search/RelevanceService.java @@ -22,7 +22,6 @@ import org.springframework.beans.factory.annotation.Value; import org.springframework.stereotype.Component; -import javax.annotation.PostConstruct; import java.time.Duration; import java.time.LocalDateTime; import java.util.Optional; @@ -48,39 +47,10 @@ public class RelevanceService { @Value("${ovsx.search.relevance.deprecated:0.5}") double deprecatedRelevance; - @Value("${ovsx.elasticsearch.relevance.rating:-1.0}") - double deprecatedElasticSearchRatingRelevance; - @Value("${ovsx.elasticsearch.relevance.downloads:-1.0}") - double deprecatedElasticSearchDownloadsRelevance; - @Value("${ovsx.elasticsearch.relevance.timestamp:-1.0}") - double deprecatedElasticSearchTimestampRelevance; - @Value("${ovsx.elasticsearch.relevance.unverified:-1.0}") - double deprecatedElasticSearchUnverifiedRelevance; - public RelevanceService(RepositoryService repositories) { this.repositories = repositories; } - @PostConstruct - void init() { - if (deprecatedElasticSearchRatingRelevance != -1.0) { - logger.warn("Using deprecated ovsx.elasticsearch.relevance.rating property. It has been renamed to ovsx.search.relevance.rating."); - this.ratingRelevance = deprecatedElasticSearchRatingRelevance; - } - if (deprecatedElasticSearchDownloadsRelevance != -1.0) { - logger.warn("Using deprecated ovsx.elasticsearch.relevance.downloads property. It has been renamed to ovsx.search.relevance.rating."); - this.downloadsRelevance = deprecatedElasticSearchDownloadsRelevance; - } - if (deprecatedElasticSearchTimestampRelevance != -1.0) { - logger.warn("Using deprecated ovsx.elasticsearch.relevance.timestamp property. It has been renamed to ovsx.search.relevance.rating."); - this.timestampRelevance = deprecatedElasticSearchTimestampRelevance; - } - if (deprecatedElasticSearchUnverifiedRelevance != -1.0) { - logger.warn("Using deprecated ovsx.elasticsearch.relevance.unverified property. It has been renamed to ovsx.search.relevance.rating."); - this.unverifiedRelevance = deprecatedElasticSearchUnverifiedRelevance; - } - } - public ExtensionSearch toSearchEntry(Extension extension, SearchStats stats) { var latest = repositories.findLatestVersion(extension, null, false, true); var targetPlatforms = repositories.findExtensionTargetPlatforms(extension);