Implements the search part

This commit is contained in:
2016-01-26 12:31:03 +01:00
parent 5f2208839d
commit f6a884b188
6 changed files with 100 additions and 15 deletions

View File

@@ -21,9 +21,11 @@ func (s *BleveIndexerSuite) SetUpSuite(c *C) {
start := time.Now()
s.i, err = bleve.New(filepath.Join(c.MkDir(), "satbd-test.bar.satellite"), buildAlbumMapping())
c.Assert(err, IsNil)
batch := s.i.NewBatch()
for _, a := range albumsDataTest {
c.Assert(s.i.Index(AlbumIDString(a.ID), &a), IsNil)
c.Assert(batch.Index(AlbumIDString(a.ID), &a), IsNil)
}
c.Assert(s.i.Batch(batch), IsNil)
log.Printf("Indexing took %s", time.Since(start))
}