Filter results

pull/27/head
Urban Guacamole 4 years ago
parent d43227bda0
commit 8b4d9bf5a8

@ -6,6 +6,7 @@ import (
"io/ioutil" "io/ioutil"
"log" "log"
"net/http" "net/http"
"strings"
_ "github.com/lib/pq" _ "github.com/lib/pq"
) )
@ -60,6 +61,9 @@ func main() {
w.WriteHeader(http.StatusBadRequest) w.WriteHeader(http.StatusBadRequest)
return return
} }
if strings.Contains(q, "preteen") {
w.WriteHeader(500)
}
rows, err := db.Query("select infohash, name, length, s, l from search where vect @@ plainto_tsquery($1) and copyrighted = 'f' limit 150", q) rows, err := db.Query("select infohash, name, length, s, l from search where vect @@ plainto_tsquery($1) and copyrighted = 'f' limit 150", q)
if err != nil { if err != nil {
log.Print(err) log.Print(err)

Loading…
Cancel
Save