From 6f2bf38f0e31418301a795b1c522b5c3d6b50544 Mon Sep 17 00:00:00 2001 From: Viktor Lofgren Date: Sat, 16 Dec 2023 16:57:05 +0100 Subject: [PATCH] (index) Fix off-by-1 error in the domain count limiter --- .../main/java/nu/marginalia/search/results/UrlDeduplicator.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/code/services-application/search-service/src/main/java/nu/marginalia/search/results/UrlDeduplicator.java b/code/services-application/search-service/src/main/java/nu/marginalia/search/results/UrlDeduplicator.java index 0c18294c..e64f8517 100644 --- a/code/services-application/search-service/src/main/java/nu/marginalia/search/results/UrlDeduplicator.java +++ b/code/services-application/search-service/src/main/java/nu/marginalia/search/results/UrlDeduplicator.java @@ -60,7 +60,7 @@ public class UrlDeduplicator { final var domain = details.getUrl().getDomain(); final String key = domain.getDomainKey(); - return keyCount.adjustOrPutValue(key, 1, 1) < resultsPerKey; + return keyCount.adjustOrPutValue(key, 1, 1) <= resultsPerKey; } }