From 16526d283c9e3c6d455ffd9e12052b17a0082647 Mon Sep 17 00:00:00 2001 From: Viktor Lofgren Date: Thu, 15 Feb 2024 18:13:34 +0100 Subject: [PATCH] (search) Correct accidental regression of the Vintage filter --- .../nu/marginalia/search/SearchQueryParamFactory.java | 5 +++-- .../nu/marginalia/search/command/SearchParameters.java | 8 ++++++++ 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/code/services-application/search-service/src/main/java/nu/marginalia/search/SearchQueryParamFactory.java b/code/services-application/search-service/src/main/java/nu/marginalia/search/SearchQueryParamFactory.java index 456fad91..69a9a97a 100644 --- a/code/services-application/search-service/src/main/java/nu/marginalia/search/SearchQueryParamFactory.java +++ b/code/services-application/search-service/src/main/java/nu/marginalia/search/SearchQueryParamFactory.java @@ -21,6 +21,7 @@ public class SearchQueryParamFactory { userParams.js().addTacitTerms(prototype); userParams.adtech().addTacitTerms(prototype); + return new QueryParams( userParams.query(), null, @@ -29,8 +30,8 @@ public class SearchQueryParamFactory { prototype.searchTermsPriority, prototype.searchTermsAdvice, profile.getQualityLimit(), - SpecificationLimit.none(), - profile.getSizeLimit(), + profile.getYearLimit(), + userParams.yearLimit(), SpecificationLimit.none(), SpecificationLimit.none(), List.of(), diff --git a/code/services-application/search-service/src/main/java/nu/marginalia/search/command/SearchParameters.java b/code/services-application/search-service/src/main/java/nu/marginalia/search/command/SearchParameters.java index 5b2df90e..eed5b451 100644 --- a/code/services-application/search-service/src/main/java/nu/marginalia/search/command/SearchParameters.java +++ b/code/services-application/search-service/src/main/java/nu/marginalia/search/command/SearchParameters.java @@ -3,6 +3,7 @@ package nu.marginalia.search.command; import nu.marginalia.WebsiteUrl; import nu.marginalia.index.client.model.results.ResultRankingParameters; import nu.marginalia.index.query.limit.QueryStrategy; +import nu.marginalia.index.query.limit.SpecificationLimit; import nu.marginalia.search.model.SearchProfile; import java.net.URLEncoder; @@ -71,4 +72,11 @@ public record SearchParameters(String query, return QueryStrategy.AUTO; } + + public SpecificationLimit yearLimit() { + if (recent == RECENT) + return SpecificationLimit.greaterThan(2018); + + return profile.getYearLimit(); + } }