mirror of https://github.com/velour/catbase.git
Fixes #30: Lowercasing the search
This commit is contained in:
parent
49939d62c0
commit
d298dac814
|
@ -247,6 +247,7 @@ var rootIndex string = `
|
|||
<head>
|
||||
<title>Factoids</title>
|
||||
<link rel="stylesheet" href="http://yui.yahooapis.com/pure/0.1.0/pure-min.css">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
</head>
|
||||
{{if .EndPoints}}
|
||||
<div style="padding-top: 1em;">
|
||||
|
|
|
@ -517,7 +517,7 @@ func (p *FactoidPlugin) serveQuery(w http.ResponseWriter, r *http.Request) {
|
|||
}
|
||||
if e := r.FormValue("entry"); e != "" {
|
||||
var entries []Factoid
|
||||
p.Coll.Find(bson.M{"trigger": bson.M{"$regex": e}}).All(&entries)
|
||||
p.Coll.Find(bson.M{"trigger": bson.M{"$regex": strings.ToLower(e)}}).All(&entries)
|
||||
context["Count"] = fmt.Sprintf("%d", len(entries))
|
||||
context["Entries"] = entries
|
||||
context["Search"] = e
|
||||
|
|
Loading…
Reference in New Issue