Browse Source

models2: Fixed text search not working.

1.0 1.0.0
Gisle Aune 6 years ago
parent
commit
d3277c7476
  1. 2
      models/logs/db.go
  2. 2
      models/logs/list.go

2
models/logs/db.go

@ -44,7 +44,7 @@ func makeLogID(date time.Time, channel string) string {
func init() { func init() {
store.HandleInit(func(db *mgo.Database) { store.HandleInit(func(db *mgo.Database) {
collection = db.C("logbot3.logs") collection = db.C("logbot3.logs")
postCollection = db.C("logbo3.posts")
postCollection = db.C("logbot3.posts")
collection.EnsureIndexKey("date") collection.EnsureIndexKey("date")
collection.EnsureIndexKey("channel") collection.EnsureIndexKey("channel")

2
models/logs/list.go

@ -64,7 +64,7 @@ func search(text string) ([]string, error) {
} }
ids := make([]string, 0, 64) ids := make([]string, 0, 64)
err := postCollection.Find(query).Distinct("logId", ids)
err := postCollection.Find(query).Distinct("logId", &ids)
return ids, err return ids, err
} }
Loading…
Cancel
Save