diff --git a/server/rutor/rutor.go b/server/rutor/rutor.go index ed44794..c984996 100644 --- a/server/rutor/rutor.go +++ b/server/rutor/rutor.go @@ -137,6 +137,9 @@ func loadDB() { log.TLogln("Index rutor db") torrsearch.NewIndex(torrs) + log.TLogln("Torrents count:", len(torrs)) + log.TLogln("Indexed words:", len(torrsearch.GetIDX())) + } else { log.TLogln("Error load rutor db:", err) } diff --git a/server/rutor/torrsearch/index.go b/server/rutor/torrsearch/index.go index 45f6e12..dd0197d 100644 --- a/server/rutor/torrsearch/index.go +++ b/server/rutor/torrsearch/index.go @@ -18,6 +18,10 @@ func Search(text string) []int { return idx.search(text) } +func GetIDX() Index { + return idx +} + func (idx Index) add(torrs []*models.TorrentDetails) { for ID, torr := range torrs { for _, token := range analyze(torr.Title) {