From d298dac814b8c5d4565b92e6db402976b1e835c5 Mon Sep 17 00:00:00 2001 From: Chris Sexton Date: Sun, 20 Apr 2014 21:12:02 -0400 Subject: [PATCH] Fixes #30: Lowercasing the search --- bot/bot.go | 1 + plugins/factoid.go | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/bot/bot.go b/bot/bot.go index df8c4c3..0f56bae 100644 --- a/bot/bot.go +++ b/bot/bot.go @@ -247,6 +247,7 @@ var rootIndex string = ` Factoids + {{if .EndPoints}}
diff --git a/plugins/factoid.go b/plugins/factoid.go index 7c2206f..e545b9f 100644 --- a/plugins/factoid.go +++ b/plugins/factoid.go @@ -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