Disable CTEs and TSQuery for now
Cette révision appartient à :
Parent
eb10a9baa3
révision
c5fe70800d
2 fichiers modifiés avec 6 ajouts et 3 suppressions
|
@ -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"
|
||||
|
|
|
@ -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
|
||||
}
|
||||
|
|
Référencer dans un nouveau ticket