зеркало из https://github.com/mozilla/pjs.git
Bug 736272 - Add extra awesomeness weight to bookmarks. r=lucasr a=android-only
This commit is contained in:
Родитель
35a7015e38
Коммит
bdc6143449
|
@ -167,8 +167,10 @@ public class LocalBrowserDB implements BrowserDB.BrowserDBIface {
|
|||
// approximation using the Cauchy distribution: multiplier = 15^2 / (age^2 + 15^2).
|
||||
// Using 15 as our scale parameter, we get a constant 15^2 = 225. Following this math,
|
||||
// frecencyScore = numVisits * max(1, 100 * 225 / (age*age + 225)). (See bug 704977)
|
||||
// We also give bookmarks an extra bonus boost by adding 100 points to their frecency score.
|
||||
final String age = "(" + Combined.DATE_LAST_VISITED + " - " + System.currentTimeMillis() + ") / 86400000";
|
||||
final String sortOrder = Combined.VISITS + " * MAX(1, 100 * 225 / (" + age + "*" + age + " + 225)) DESC";
|
||||
final String sortOrder = "(CASE WHEN " + Combined.BOOKMARK_ID + " > -1 THEN 100 ELSE 0 END) + " +
|
||||
Combined.VISITS + " * MAX(1, 100 * 225 / (" + age + "*" + age + " + 225)) DESC";
|
||||
|
||||
Cursor c = cr.query(combinedUriWithLimit(limit),
|
||||
projection,
|
||||
|
|
Загрузка…
Ссылка в новой задаче