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