From bbc0e3afcac64bbcee552e179081f658c7ce51cf Mon Sep 17 00:00:00 2001 From: YouROK <8YouROK8@mail.ru> Date: Mon, 6 Feb 2023 21:09:00 +0300 Subject: [PATCH] fix search --- server/rutor/torrsearch/index.go | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/server/rutor/torrsearch/index.go b/server/rutor/torrsearch/index.go index 74d459c..45f6e12 100644 --- a/server/rutor/torrsearch/index.go +++ b/server/rutor/torrsearch/index.go @@ -2,7 +2,6 @@ package torrsearch import ( "server/rutor/models" - "strconv" ) // Index is an inverted Index. It maps tokens to document IDs. @@ -21,7 +20,7 @@ func Search(text string) []int { func (idx Index) add(torrs []*models.TorrentDetails) { for ID, torr := range torrs { - for _, token := range analyze(torr.Name + " " + torr.GetNames() + " " + strconv.Itoa(torr.Year)) { + for _, token := range analyze(torr.Title) { ids := idx[token] if ids != nil && ids[len(ids)-1] == ID { // Don't add same ID twice.