From 89b4e0477b4e1b9e1cccd87b68fde4ea8a578e9c Mon Sep 17 00:00:00 2001 From: Lunny Xiao Date: Mon, 23 Dec 2019 20:31:16 +0800 Subject: Refactor code indexer (#9313) * Refactor code indexer * fix test * fix test * refactor code indexer * fix import * improve code * fix typo * fix test and make code clean * fix lint --- routers/home.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'routers/home.go') diff --git a/routers/home.go b/routers/home.go index 50e1a2b2a4..4d4bfa5620 100644 --- a/routers/home.go +++ b/routers/home.go @@ -12,8 +12,8 @@ import ( "code.gitea.io/gitea/models" "code.gitea.io/gitea/modules/base" "code.gitea.io/gitea/modules/context" + code_indexer "code.gitea.io/gitea/modules/indexer/code" "code.gitea.io/gitea/modules/log" - "code.gitea.io/gitea/modules/search" "code.gitea.io/gitea/modules/setting" "code.gitea.io/gitea/modules/util" "code.gitea.io/gitea/routers/user" @@ -312,7 +312,7 @@ func ExploreCode(ctx *context.Context) { var ( total int - searchResults []*search.Result + searchResults []*code_indexer.Result ) // if non-admin login user, we need check UnitTypeCode at first @@ -334,14 +334,14 @@ func ExploreCode(ctx *context.Context) { ctx.Data["RepoMaps"] = rightRepoMap - total, searchResults, err = search.PerformSearch(repoIDs, keyword, page, setting.UI.RepoSearchPagingNum) + total, searchResults, err = code_indexer.PerformSearch(repoIDs, keyword, page, setting.UI.RepoSearchPagingNum) if err != nil { ctx.ServerError("SearchResults", err) return } // if non-login user or isAdmin, no need to check UnitTypeCode } else if (ctx.User == nil && len(repoIDs) > 0) || isAdmin { - total, searchResults, err = search.PerformSearch(repoIDs, keyword, page, setting.UI.RepoSearchPagingNum) + total, searchResults, err = code_indexer.PerformSearch(repoIDs, keyword, page, setting.UI.RepoSearchPagingNum) if err != nil { ctx.ServerError("SearchResults", err) return -- cgit v1.2.3