From f0e736d4eab4ac7b82386a06df7d8b82677b4af3 Mon Sep 17 00:00:00 2001 From: Viktor Lofgren Date: Sat, 9 Dec 2023 16:46:51 +0100 Subject: [PATCH] (search) Update the search profile 'Academia' to strictly filter on academic tlds The previous version used a personalized pagerank centering on a few academic domains, but this didn't work very well and most results were not very academia-centric. --- .../marginalia/search/model/SearchProfile.java | 17 ++--------------- 1 file changed, 2 insertions(+), 15 deletions(-) diff --git a/code/services-application/search-service/src/main/java/nu/marginalia/search/model/SearchProfile.java b/code/services-application/search-service/src/main/java/nu/marginalia/search/model/SearchProfile.java index 97bf4d09..630e7f1a 100644 --- a/code/services-application/search-service/src/main/java/nu/marginalia/search/model/SearchProfile.java +++ b/code/services-application/search-service/src/main/java/nu/marginalia/search/model/SearchProfile.java @@ -15,11 +15,9 @@ public enum SearchProfile { VINTAGE("vintage", SearchSetIdentifier.NONE), TILDE("tilde", SearchSetIdentifier.NONE), CORPO_CLEAN("corpo-clean", SearchSetIdentifier.NONE), - ACADEMIA("academia", SearchSetIdentifier.ACADEMIA), + ACADEMIA("academia", SearchSetIdentifier.NONE), PLAIN_TEXT("plain-text", SearchSetIdentifier.NONE), FOOD("food", SearchSetIdentifier.NONE), - CRAFTS("crafts", SearchSetIdentifier.NONE), - CLASSICS("classics", SearchSetIdentifier.NONE), FORUM("forum", SearchSetIdentifier.NONE), WIKI("wiki", SearchSetIdentifier.NONE), DOCS("docs", SearchSetIdentifier.NONE), @@ -51,7 +49,7 @@ public enum SearchProfile { public void addTacitTerms(SearchSubquery subquery) { if (this == ACADEMIA) { - subquery.searchTermsPriority.add("tld:edu"); + subquery.searchTermsAdvice.add("special:academia"); } if (this == VINTAGE) { subquery.searchTermsPriority.add("format:html123"); @@ -75,9 +73,6 @@ public enum SearchProfile { if (this == FOOD) { subquery.searchTermsAdvice.add(HtmlFeature.CATEGORY_FOOD.getKeyword()); } - if (this == CRAFTS) { - subquery.searchTermsAdvice.add(HtmlFeature.CATEGORY_CRAFTS.getKeyword()); - } } public SpecificationLimit getYearLimit() { @@ -105,13 +100,5 @@ public enum SearchProfile { else return SpecificationLimit.none(); } - - - public String getNearDomain() { - if (this == CLASSICS) { - return "classics.mit.edu"; - } - return null; - } }