diff options
author | wxiaoguang <wxiaoguang@gmail.com> | 2025-03-13 11:07:48 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2025-03-13 11:07:48 +0800 |
commit | 403775e74ed11097b30a9a683b2253c0967c0dcd (patch) | |
tree | 3d5d4c7687428cad146f7650822c1f0a2af72240 /modules/indexer/code/internal/util.go | |
parent | cd10456664ce763212f6841be7839ab5d4229c18 (diff) | |
download | gitea-403775e74ed11097b30a9a683b2253c0967c0dcd.tar.gz gitea-403775e74ed11097b30a9a683b2253c0967c0dcd.zip |
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.
Diffstat (limited to 'modules/indexer/code/internal/util.go')
-rw-r--r-- | modules/indexer/code/internal/util.go | 12 |
1 files changed, 1 insertions, 11 deletions
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 -} |