(*) Rename the search filter 'RETRO' into 'POPULAR'
This will make the terminology more consistent between the GUI and the code. The rankings yaml still uses 'retro' though, for to retain compatibility.
This commit is contained in:
parent
6382f779c3
commit
e3ebb0c5bb
@ -7,7 +7,7 @@ package nu.marginalia.index.client.model.query;
|
||||
* */
|
||||
public enum SearchSetIdentifier {
|
||||
NONE,
|
||||
RETRO,
|
||||
POPULAR,
|
||||
BLOGS,
|
||||
ACADEMIA,
|
||||
SMALLWEB
|
||||
|
@ -10,8 +10,6 @@ import nu.marginalia.index.client.model.query.SearchSetIdentifier;
|
||||
import nu.marginalia.index.client.model.results.DecoratedSearchResultItem;
|
||||
import nu.marginalia.index.client.model.results.SearchResultKeywordScore;
|
||||
import nu.marginalia.index.query.limit.QueryLimits;
|
||||
import nu.marginalia.index.query.limit.SpecificationLimit;
|
||||
import nu.marginalia.index.searchset.SearchSet;
|
||||
import nu.marginalia.model.idx.WordMetadata;
|
||||
import nu.marginalia.query.client.QueryClient;
|
||||
import nu.marginalia.query.model.QueryParams;
|
||||
@ -64,7 +62,7 @@ public class ApiSearchOperator {
|
||||
return switch (index) {
|
||||
case 0 -> SearchSetIdentifier.NONE;
|
||||
case 1 -> SearchSetIdentifier.SMALLWEB;
|
||||
case 2 -> SearchSetIdentifier.RETRO;
|
||||
case 2 -> SearchSetIdentifier.POPULAR;
|
||||
case 3 -> SearchSetIdentifier.NONE;
|
||||
case 5 -> SearchSetIdentifier.NONE;
|
||||
default -> SearchSetIdentifier.NONE;
|
||||
|
@ -5,7 +5,6 @@ import nu.marginalia.WebsiteUrl;
|
||||
import nu.marginalia.search.command.SearchAdtechParameter;
|
||||
import nu.marginalia.search.command.SearchJsParameter;
|
||||
import nu.marginalia.search.command.SearchParameters;
|
||||
import org.apache.regexp.RE;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@ -37,7 +36,7 @@ public class SearchFilters {
|
||||
filterGroups = List.of(
|
||||
List.of(
|
||||
new Filter("No Filter", SearchProfile.NO_FILTER, parameters),
|
||||
new Filter("Popular", SearchProfile.DEFAULT, parameters),
|
||||
new Filter("Popular", SearchProfile.POPULAR, parameters),
|
||||
new Filter("Small Web", SearchProfile.SMALLWEB, parameters),
|
||||
new Filter("Blogosphere", SearchProfile.BLOGOSPHERE, parameters),
|
||||
new Filter("Academia", SearchProfile.ACADEMIA, parameters)
|
||||
|
@ -8,11 +8,10 @@ import nu.marginalia.index.client.model.query.SearchSetIdentifier;
|
||||
import java.util.Objects;
|
||||
|
||||
public enum SearchProfile {
|
||||
DEFAULT("default", SearchSetIdentifier.RETRO),
|
||||
POPULAR("default", SearchSetIdentifier.POPULAR),
|
||||
SMALLWEB("modern", SearchSetIdentifier.SMALLWEB),
|
||||
BLOGOSPHERE("blogosphere", SearchSetIdentifier.BLOGS),
|
||||
NO_FILTER("corpo", SearchSetIdentifier.NONE),
|
||||
YOLO("yolo", SearchSetIdentifier.NONE),
|
||||
VINTAGE("vintage", SearchSetIdentifier.NONE),
|
||||
TILDE("tilde", SearchSetIdentifier.NONE),
|
||||
CORPO_CLEAN("corpo-clean", SearchSetIdentifier.NONE),
|
||||
@ -38,7 +37,7 @@ public enum SearchProfile {
|
||||
private final static SearchProfile[] values = values();
|
||||
public static SearchProfile getSearchProfile(String param) {
|
||||
if (null == param) {
|
||||
return DEFAULT;
|
||||
return POPULAR;
|
||||
}
|
||||
|
||||
for (var profile : values) {
|
||||
@ -47,7 +46,7 @@ public enum SearchProfile {
|
||||
}
|
||||
}
|
||||
|
||||
return DEFAULT;
|
||||
return POPULAR;
|
||||
}
|
||||
|
||||
public void addTacitTerms(SearchSubquery subquery) {
|
||||
|
@ -37,7 +37,7 @@ public class IndexSearchSetsService {
|
||||
|
||||
|
||||
// Below are binary indices that are used to constrain a search
|
||||
private volatile RankingSearchSet retroSet;
|
||||
private volatile RankingSearchSet popularSet;
|
||||
private volatile RankingSearchSet smallWebSet;
|
||||
private volatile RankingSearchSet academiaSet;
|
||||
private volatile RankingSearchSet blogsSet;
|
||||
@ -72,7 +72,7 @@ public class IndexSearchSetsService {
|
||||
|
||||
smallWebSet = new RankingSearchSet(SearchSetIdentifier.SMALLWEB, servicesFactory.getSearchSetsBase().resolve("small-web.dat"));
|
||||
academiaSet = new RankingSearchSet(SearchSetIdentifier.ACADEMIA, servicesFactory.getSearchSetsBase().resolve("academia.dat"));
|
||||
retroSet = new RankingSearchSet(SearchSetIdentifier.RETRO, servicesFactory.getSearchSetsBase().resolve("retro.dat"));
|
||||
popularSet = new RankingSearchSet(SearchSetIdentifier.POPULAR, servicesFactory.getSearchSetsBase().resolve("popular.dat"));
|
||||
blogsSet = new RankingSearchSet(SearchSetIdentifier.BLOGS, servicesFactory.getSearchSetsBase().resolve("blogs.dat"));
|
||||
}
|
||||
|
||||
@ -86,7 +86,7 @@ public class IndexSearchSetsService {
|
||||
}
|
||||
return switch (searchSetIdentifier) {
|
||||
case NONE -> anySet;
|
||||
case RETRO -> retroSet;
|
||||
case POPULAR -> popularSet;
|
||||
case ACADEMIA -> academiaSet;
|
||||
case SMALLWEB -> smallWebSet;
|
||||
case BLOGS -> blogsSet;
|
||||
@ -95,7 +95,7 @@ public class IndexSearchSetsService {
|
||||
|
||||
enum RepartitionSteps {
|
||||
UPDATE_ACADEMIA,
|
||||
UPDATE_RETRO,
|
||||
UPDATE_POPULAR,
|
||||
UPDATE_SMALL_WEB,
|
||||
UPDATE_BLOGS,
|
||||
UPDATE_RANKINGS,
|
||||
@ -107,8 +107,8 @@ public class IndexSearchSetsService {
|
||||
processHeartbeat.progress(RepartitionSteps.UPDATE_ACADEMIA);
|
||||
updateAcademiaDomainsSet();
|
||||
|
||||
processHeartbeat.progress(RepartitionSteps.UPDATE_RETRO);
|
||||
updateRetroDomainsSet();
|
||||
processHeartbeat.progress(RepartitionSteps.UPDATE_POPULAR);
|
||||
updatePopularDomainsSet();
|
||||
|
||||
processHeartbeat.progress(RepartitionSteps.UPDATE_SMALL_WEB);
|
||||
updateSmallWebDomainsSet();
|
||||
@ -139,15 +139,15 @@ public class IndexSearchSetsService {
|
||||
}
|
||||
|
||||
@SneakyThrows
|
||||
public void updateRetroDomainsSet() {
|
||||
public void updatePopularDomainsSet() {
|
||||
var entry = rankingSettings.retro;
|
||||
|
||||
var spr = new StandardPageRank(similarityDomains, entry.domains.toArray(String[]::new));
|
||||
var data = spr.pageRankWithPeripheralNodes(entry.max, RankingResultHashSetAccumulator::new);
|
||||
|
||||
synchronized (this) {
|
||||
retroSet = new RankingSearchSet(SearchSetIdentifier.RETRO, retroSet.source, data);
|
||||
retroSet.write();
|
||||
popularSet = new RankingSearchSet(SearchSetIdentifier.POPULAR, popularSet.source, data);
|
||||
popularSet.write();
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user