diff options
author | Mike Goldin <mike.goldin@protonmail.ch> | 2020-10-15 09:03:18 -0400 |
---|---|---|
committer | Mike Goldin <mike.goldin@protonmail.ch> | 2020-11-17 08:09:51 -0500 |
commit | ef0727860ad652e0836b74d4a94e840f5102e243 (patch) | |
tree | c9b908f001ad62b4bd982d15c04e4033cc904123 /cache/repo_cache.go | |
parent | 0a827af60acc0e37a4c25b4ffc059b4bb020b77c (diff) | |
download | git-bug-ef0727860ad652e0836b74d4a94e840f5102e243.tar.gz |
Add full-text search support in the ls command
Diffstat (limited to 'cache/repo_cache.go')
-rw-r--r-- | cache/repo_cache.go | 21 |
1 files changed, 2 insertions, 19 deletions
diff --git a/cache/repo_cache.go b/cache/repo_cache.go index 632469e4..8bce3d8c 100644 --- a/cache/repo_cache.go +++ b/cache/repo_cache.go @@ -207,9 +207,9 @@ func (c *RepoCache) buildCache() error { allBugs := bug.ReadAllLocal(c.repo) - err := c.ensureBleveIndex() + err := c.createBleveIndex() if err != nil { - return fmt.Errorf("Unable to create or open search cache. Error: %v", err) + return fmt.Errorf("Unable to create search cache. Error: %v", err) } for b := range allBugs { @@ -230,23 +230,6 @@ func (c *RepoCache) buildCache() error { return nil } -func (c *RepoCache) addBugToSearchIndex(snap *bug.Snapshot) error { - searchableBug := struct { - Text []string - }{} - - for _, comment := range snap.Comments { - searchableBug.Text = append(searchableBug.Text, comment.Message) - } - - err := c.searchCache.Index(snap.Id().String(), searchableBug) - if err != nil { - return err - } - - return nil -} - func repoLockFilePath(repo repository.Repo) string { return path.Join(repo.GetPath(), "git-bug", lockfile) } |