Use Comparator.comparingDouble().

pull/8728/head
Isira Seneviratne 2022-08-03 06:01:32 +05:30
rodzic 059cfcbad2
commit d1f3f15478
1 zmienionych plików z 1 dodań i 1 usunięć

Wyświetl plik

@ -31,7 +31,7 @@ public class PreferenceFuzzySearchFunction
// Specific search - Used for determining order of search results
// Calculate a score based on specific search fields
.map(item -> new FuzzySearchSpecificDTO(item, keyword))
.sorted(Comparator.comparing(FuzzySearchSpecificDTO::getScore).reversed())
.sorted(Comparator.comparingDouble(FuzzySearchSpecificDTO::getScore).reversed())
.map(FuzzySearchSpecificDTO::getItem)
// Limit the amount of search results
.limit(20);