1
1
mirror of https://github.com/MarginaliaSearch/MarginaliaSearch.git synced 2025-10-05 21:22:39 +02:00

(search) Make exploration mode more random

This commit is contained in:
Viktor Lofgren
2023-05-25 17:40:28 +02:00
parent 6fae51a8ef
commit 1e184a8372

View File

@@ -23,6 +23,8 @@ import java.util.*;
import java.util.function.Predicate;
import java.util.regex.Pattern;
import static java.util.Collections.shuffle;
public class BrowseCommand implements SearchCommandInterface {
private final DbBrowseDomainsRandom randomDomains;
private final DbBrowseDomainsSimilarCosine similarDomains;
@@ -110,7 +112,8 @@ public class BrowseCommand implements SearchCommandInterface {
neighbors.removeIf(browseResultCleaner.shouldRemoveResultPredicate());
}
neighbors.sort(Comparator.comparing(BrowseResult::relatedness).reversed());
// shuffle the items for a less repetitive experience
shuffle(neighbors);
return new BrowseResultSet(neighbors);
}