From 403775e74ed11097b30a9a683b2253c0967c0dcd Mon Sep 17 00:00:00 2001 From: wxiaoguang Date: Thu, 13 Mar 2025 11:07:48 +0800 Subject: Improve issue & code search (#33860) Each "indexer" should provide the "search modes" they support by themselves. And we need to remove the "fuzzy" search for code. --- modules/indexer/code/internal/util.go | 12 +----------- 1 file changed, 1 insertion(+), 11 deletions(-) (limited to 'modules/indexer/code/internal/util.go') diff --git a/modules/indexer/code/internal/util.go b/modules/indexer/code/internal/util.go index 46e631166d..fa958be473 100644 --- a/modules/indexer/code/internal/util.go +++ b/modules/indexer/code/internal/util.go @@ -10,9 +10,7 @@ import ( "code.gitea.io/gitea/modules/log" ) -const ( - filenameMatchNumberOfLines = 7 // Copied from github search -) +const filenameMatchNumberOfLines = 7 // Copied from GitHub search func FilenameIndexerID(repoID int64, filename string) string { return internal.Base36(repoID) + "_" + filename @@ -48,11 +46,3 @@ func FilenameMatchIndexPos(content string) (int, int) { } return 0, len(content) } - -func ParseKeywordAsPhrase(keyword string) (string, bool) { - if strings.HasPrefix(keyword, `"`) && strings.HasSuffix(keyword, `"`) && len(keyword) > 1 { - // only remove the prefix and suffix quotes, no need to decode the content at the moment - return keyword[1 : len(keyword)-1], true - } - return "", false -} -- cgit v1.2.3