Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions pre.go
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ func searchPres(tx *sql.Tx, q string, offsetInt, countInt int, withNukes bool) (
sqlQuery := fmt.Sprintf("SELECT %s FROM %s WHERE MATCH(?) ORDER BY id DESC LIMIT %d,%d", preColumns, sphinxTable, offsetInt, countInt)

if offsetInt+countInt > defaultMaxMatches {
sqlQuery += ", max_matches = " + strconv.Itoa(offsetInt+countInt)
sqlQuery += " OPTION max_matches = " + strconv.Itoa(offsetInt+countInt)
}

sqlRows, err := tx.Query(sqlQuery, replacer.Replace(q))
Expand All @@ -107,7 +107,7 @@ func latestPres(tx *sql.Tx, offsetInt, countInt int, withNukes bool) ([]preRow,
sqlQuery := fmt.Sprintf("SELECT %s FROM %s ORDER BY id DESC LIMIT %d,%d", preColumns, sphinxTable, offsetInt, countInt)

if offsetInt+countInt > defaultMaxMatches {
sqlQuery += ", max_matches = " + strconv.Itoa(offsetInt+countInt)
sqlQuery += " OPTION max_matches = " + strconv.Itoa(offsetInt+countInt)
}

sqlRows, err := tx.Query(sqlQuery)
Expand Down