tweak search result ranking

This commit is contained in:
MM20
2025-10-17 15:48:58 +02:00
parent 496ca97dc8
commit 5a575738ac
3 changed files with 5 additions and 4 deletions

View File

@@ -183,7 +183,7 @@ interface SearchableDao {
@Query("UPDATE Searchable SET launchCount = launchCount + 1 WHERE `key` = :key")
fun incrementLaunchCount(key: String)
@Query("UPDATE Searchable SET `weight` = `weight` * (1.0 - :alpha) WHERE `key` != :key")
@Query("UPDATE Searchable SET `weight` = `weight` * (1.0 - :alpha) WHERE `key` != :key AND weight > 0.001")
fun reduceWeightExcept(key: String, alpha: Double)
@Query("UPDATE Searchable SET `weight` = `weight` + :alpha * (1.0 - `weight`) WHERE `key` == :key")