Skip to content

Commit 2ccccd8

Browse files
authored
Merge pull request #1273 from iftechfoundation/searchutil-inner-join-gameratings
Make game searches do an inner join to `gameRatingsSandbox0_mv`
2 parents bca9038 + cf2d608 commit 2ccccd8

File tree

1 file changed

+2
-9
lines changed

1 file changed

+2
-9
lines changed

www/searchutil.php

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -286,15 +286,8 @@ function doSearch($db, $term, $searchType, $sortby, $limit, $browse, $count_all_
286286
$baseWhere = "";
287287
$groupBy = "";
288288
$baseOrderBy = "";
289-
if ($browse && ($sortby == "" || $sortby == "ratu" || $sortby == "ratd" || $sortby == "rcu")) {
290-
// when sorting by highest/lowest/most ratings, we can optimize by
291-
// fetching the top N from the gameRatingsView
292-
$tableList = "games
293-
join ".getGameRatingsView($db)." on games.id = gameid";
294-
} else {
295-
$tableList = "games
296-
left join ".getGameRatingsView($db)." on games.id = gameid";
297-
}
289+
$tableList = "games
290+
join ".getGameRatingsView($db)." on games.id = gameid";
298291
$matchCols = "title, author, `desc`, tags";
299292
$likeCol = "title";
300293
$summaryDesc = "Games";

0 commit comments

Comments
 (0)