From b0f7457d9ef6e16d4a3197f7544035d5d387e201 Mon Sep 17 00:00:00 2001 From: Ethan Koenig Date: Sat, 16 Sep 2017 13:16:21 -0700 Subject: Improve issue search (#2387) * Improve issue indexer * Fix new issue sqlite bug * Different test indexer paths for each db * Add integration indexer paths to make clean --- routers/init.go | 3 +-- routers/repo/issue.go | 3 ++- 2 files changed, 3 insertions(+), 3 deletions(-) (limited to 'routers') diff --git a/routers/init.go b/routers/init.go index 5113ec4cef..d04ffea4c1 100644 --- a/routers/init.go +++ b/routers/init.go @@ -13,7 +13,6 @@ import ( "code.gitea.io/gitea/models/migrations" "code.gitea.io/gitea/modules/cron" "code.gitea.io/gitea/modules/highlight" - "code.gitea.io/gitea/modules/indexer" "code.gitea.io/gitea/modules/log" "code.gitea.io/gitea/modules/mailer" "code.gitea.io/gitea/modules/markup" @@ -63,7 +62,7 @@ func GlobalInit() { // Booting long running goroutines. cron.NewContext() - indexer.NewContext() + models.InitIssueIndexer() models.InitSyncMirrors() models.InitDeliverHooks() models.InitTestPullRequests() diff --git a/routers/repo/issue.go b/routers/repo/issue.go index d5d1af7e49..4c4f9037bf 100644 --- a/routers/repo/issue.go +++ b/routers/repo/issue.go @@ -22,6 +22,7 @@ import ( "code.gitea.io/gitea/modules/auth" "code.gitea.io/gitea/modules/base" "code.gitea.io/gitea/modules/context" + "code.gitea.io/gitea/modules/indexer" "code.gitea.io/gitea/modules/log" "code.gitea.io/gitea/modules/markdown" "code.gitea.io/gitea/modules/notification" @@ -142,7 +143,7 @@ func Issues(ctx *context.Context) { var issueIDs []int64 var err error if len(keyword) > 0 { - issueIDs, err = models.SearchIssuesByKeyword(repo.ID, keyword) + issueIDs, err = indexer.SearchIssuesByKeyword(repo.ID, keyword) if len(issueIDs) == 0 { forceEmpty = true } -- cgit v1.2.3