diff options
author | Lunny Xiao <xiaolunwen@gmail.com> | 2019-12-23 20:31:16 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-12-23 20:31:16 +0800 |
commit | 89b4e0477b4e1b9e1cccd87b68fde4ea8a578e9c (patch) | |
tree | 46141746472fc33dfa8c262fa96176895bc9fba8 /routers/home.go | |
parent | 2f9564f993ba02ba503d7088eb8cc70536b7a6df (diff) | |
download | gitea-89b4e0477b4e1b9e1cccd87b68fde4ea8a578e9c.tar.gz gitea-89b4e0477b4e1b9e1cccd87b68fde4ea8a578e9c.zip |
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
Diffstat (limited to 'routers/home.go')
-rw-r--r-- | routers/home.go | 8 |
1 files changed, 4 insertions, 4 deletions
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 |