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>
|
<head>
|
||||||
<title>Factoids</title>
|
<title>Factoids</title>
|
||||||
<link rel="stylesheet" href="http://yui.yahooapis.com/pure/0.1.0/pure-min.css">
|
<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>
|
</head>
|
||||||
{{if .EndPoints}}
|
{{if .EndPoints}}
|
||||||
<div style="padding-top: 1em;">
|
<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 != "" {
|
if e := r.FormValue("entry"); e != "" {
|
||||||
var entries []Factoid
|
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["Count"] = fmt.Sprintf("%d", len(entries))
|
||||||
context["Entries"] = entries
|
context["Entries"] = entries
|
||||||
context["Search"] = e
|
context["Search"] = e
|
||||||
|
|
Loading…
Reference in New Issue