diff options
author | Lauris BH <lauris@nix.lv> | 2020-02-20 21:53:55 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-02-20 16:53:55 -0300 |
commit | 3c45cf8494fcd29e1a99b0ee6f253808eb607053 (patch) | |
tree | cd0e6347bcd2bfc42c18408169a8757ca1dda920 /modules/setting/indexer.go | |
parent | efbd7ca39bde69ff84d4b309bee99edfe2977521 (diff) | |
download | gitea-3c45cf8494fcd29e1a99b0ee6f253808eb607053.tar.gz gitea-3c45cf8494fcd29e1a99b0ee6f253808eb607053.zip |
Add detected file language to code search (#10256)
Move langauge detection to separate module to be more reusable
Add option to disable vendored file exclusion from file search
Allways show all language stats for search
Diffstat (limited to 'modules/setting/indexer.go')
-rw-r--r-- | modules/setting/indexer.go | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/modules/setting/indexer.go b/modules/setting/indexer.go index 859535281c..4d4df62014 100644 --- a/modules/setting/indexer.go +++ b/modules/setting/indexer.go @@ -41,6 +41,7 @@ var ( MaxIndexerFileSize int64 IncludePatterns []glob.Glob ExcludePatterns []glob.Glob + ExcludeVendored bool }{ IssueType: "bleve", IssuePath: "indexers/issues.bleve", @@ -52,6 +53,7 @@ var ( IssueQueueBatchNumber: 20, MaxIndexerFileSize: 1024 * 1024, + ExcludeVendored: true, } ) @@ -77,6 +79,7 @@ func newIndexerService() { } Indexer.IncludePatterns = IndexerGlobFromString(sec.Key("REPO_INDEXER_INCLUDE").MustString("")) Indexer.ExcludePatterns = IndexerGlobFromString(sec.Key("REPO_INDEXER_EXCLUDE").MustString("")) + Indexer.ExcludeVendored = sec.Key("REPO_INDEXER_EXCLUDE_VENDORED").MustBool(true) Indexer.UpdateQueueLength = sec.Key("UPDATE_BUFFER_LEN").MustInt(20) Indexer.MaxIndexerFileSize = sec.Key("MAX_FILE_SIZE").MustInt64(1024 * 1024) Indexer.StartupTimeout = sec.Key("STARTUP_TIMEOUT").MustDuration(30 * time.Second) |