Albirew/nyaa-pantsu
Archivé
1
0
Bifurcation 0

Disable CTEs and TSQuery for now

Cette révision appartient à :
sfan5 2017-05-12 19:38:08 +02:00
Parent eb10a9baa3
révision c5fe70800d
2 fichiers modifiés avec 6 ajouts et 3 suppressions

Voir le fichier

@ -129,9 +129,10 @@ func getTorrentsOrderBy(parameters *serviceBase.WhereParams, orderBy string, lim
if conditions != "" {
dbQuery = dbQuery + " WHERE " + conditions
}
/* This makes all queries take roughly the same amount of time (lots)...
if strings.Contains(conditions, "torrent_name") && offset > 0 {
dbQuery = "WITH t AS (SELECT * FROM torrents WHERE " + conditions + ") SELECT * FROM t"
}
}*/
if orderBy == "" { // default OrderBy
orderBy = "torrent_id DESC"

Voir le fichier

@ -21,13 +21,15 @@ var searchOperator string
var useTSQuery bool
func Configure(conf *config.SearchConfig) (err error) {
useTSQuery = false
// Postgres needs ILIKE for case-insensitivity
if db.ORM.Dialect().GetName() == "postgres" {
searchOperator = "ILIKE ?"
useTSQuery = true
//useTSQuery = true
// !!DISABLED!! because this makes search a lot stricter
// (only matches at word borders)
} else {
searchOperator = "LIKE ?"
useTSQuery = false
}
return
}