Code search + repo indexer #30761 was erronously closed #14576

Closed
opened 2025-11-02 11:16:38 -06:00 by GiteaMirror · 4 comments
Owner

Originally created by @danieldemus on GitHub (Jun 9, 2025).

Description

I also get "Current code search results are provided by "git grep". There might be better results if site administrator enables Repository Indexer." even though it is enabled in app.ini.
I note that there is no mention of the repo code indexer in the logs, only the issue indexer and repo stats.
"2025/06/09 21:39:53 ...er/issues/indexer.go:76:func1() [I] PID 442740: Initializing Issue Indexer: bleve
2025/06/09 21:39:53 ...xer/stats/indexer.go:41:populateRepoIndexer() [I] Populating the repo stats indexer with existing repositories
2025/06/09 21:39:53 ...xer/stats/indexer.go:87:populateRepoIndexer() [I] Done (re)populating the repo stats indexer with existing repositories
2025/06/09 21:39:53 ...er/issues/indexer.go:153:func2() [I] Issue Indexer Initialization took 83.57469ms
"

Gitea Version

1.23.4

Can you reproduce the bug on the Gitea demo site?

No

Log Gist

No response

Screenshots

No response

Git Version

git version 2.49.0

Operating System

Fedora 41

How are you running Gitea?

From copr.fedorainfracloud.org:nalika:gitea.repo.

Database

PostgreSQL

Originally created by @danieldemus on GitHub (Jun 9, 2025). ### Description I also get "Current code search results are provided by "git grep". There might be better results if site administrator enables Repository Indexer." even though it is enabled in app.ini. I note that there is no mention of the repo code indexer in the logs, only the issue indexer and repo stats. "2025/06/09 21:39:53 ...er/issues/indexer.go:76:func1() [I] PID 442740: Initializing Issue Indexer: bleve 2025/06/09 21:39:53 ...xer/stats/indexer.go:41:populateRepoIndexer() [I] Populating the repo stats indexer with existing repositories 2025/06/09 21:39:53 ...xer/stats/indexer.go:87:populateRepoIndexer() [I] Done (re)populating the repo stats indexer with existing repositories 2025/06/09 21:39:53 ...er/issues/indexer.go:153:func2() [I] Issue Indexer Initialization took 83.57469ms " ### Gitea Version 1.23.4 ### Can you reproduce the bug on the Gitea demo site? No ### Log Gist _No response_ ### Screenshots _No response_ ### Git Version git version 2.49.0 ### Operating System Fedora 41 ### How are you running Gitea? From copr.fedorainfracloud.org:nalika:gitea.repo. ### Database PostgreSQL
GiteaMirror added the issue/needs-feedbackissue/not-a-bug labels 2025-11-02 11:16:38 -06:00
Author
Owner

@lunny commented on GitHub (Jun 9, 2025):

How did you enable code search?

@lunny commented on GitHub (Jun 9, 2025): How did you enable code search?
Author
Owner

@danieldemus commented on GitHub (Jun 9, 2025):

;[indexer]
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;
;; Issue Indexer settings
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;
;; Issue indexer type, currently support: bleve, db, elasticsearch or meilisearch default is bleve
ISSUE_INDEXER_TYPE = bleve
;;
;; Issue indexer storage path, available when ISSUE_INDEXER_TYPE is bleve
ISSUE_INDEXER_PATH = /home/gitea/data/indexers/issues.bleve
;;
;; Issue indexer connection string, available when ISSUE_INDEXER_TYPE is elasticsearch (e.g. http://elastic:password@localhost:9200) or meilisearch (e.g. http://:apikey@localhost:7700)
;ISSUE_INDEXER_CONN_STR =
;;
;; Issue indexer name, available when ISSUE_INDEXER_TYPE is elasticsearch or meilisearch.
;ISSUE_INDEXER_NAME = gitea_issues
;;
;; Timeout the indexer if it takes longer than this to start.
;; Set to -1 to disable timeout.
STARTUP_TIMEOUT = 30s
;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; Repository Indexer settings
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;
;; repo indexer by default disabled, since it uses a lot of disk space
REPO_INDEXER_ENABLED = true
;;
;; repo indexer units, the items to index, could be `sources`, `forks`, `mirrors`, `templates` or any combination of them separated by a comma.
;; If empty then it defaults to `sources` only, as if you'd like to disable fully please see REPO_INDEXER_ENABLED.
REPO_INDEXER_REPO_TYPES = sources,forks,mirrors,templates
;;
;; Code search engine type, could be `bleve` or `elasticsearch`.
REPO_INDEXER_TYPE = bleve
;;
;; Index file used for code search. available when `REPO_INDEXER_TYPE` is bleve
REPO_INDEXER_PATH = /home/gitea/data/indexers/repos.bleve
;;
;; Code indexer connection string, available when `REPO_INDEXER_TYPE` is elasticsearch. i.e. http://elastic:changeme@localhost:9200
;REPO_INDEXER_CONN_STR =
;;
;; Code indexer name, available when `REPO_INDEXER_TYPE` is elasticsearch
;REPO_INDEXER_NAME = gitea_codes
;;
;; A comma separated list of glob patterns (see https://github.com/gobwas/glob) to include
;; in the index; default is empty
;REPO_INDEXER_INCLUDE =
;;
;; A comma separated list of glob patterns to exclude from the index; ; default is empty
;REPO_INDEXER_EXCLUDE =
;;
REPO_INDEXER_EXCLUDE_VENDORED = false
;MAX_FILE_SIZE = 1048576
;;
;; Bleve engine has performance problems with fuzzy search, so we limit the fuzziness to 0 by default to disable it.
;; If you'd like to enable it, you can set it to a value between 0 and 2.
;TYPE_BLEVE_MAX_FUZZINESS = 0
@danieldemus commented on GitHub (Jun 9, 2025): ``` ;[indexer] ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; ;; Issue Indexer settings ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; ;; Issue indexer type, currently support: bleve, db, elasticsearch or meilisearch default is bleve ISSUE_INDEXER_TYPE = bleve ;; ;; Issue indexer storage path, available when ISSUE_INDEXER_TYPE is bleve ISSUE_INDEXER_PATH = /home/gitea/data/indexers/issues.bleve ;; ;; Issue indexer connection string, available when ISSUE_INDEXER_TYPE is elasticsearch (e.g. http://elastic:password@localhost:9200) or meilisearch (e.g. http://:apikey@localhost:7700) ;ISSUE_INDEXER_CONN_STR = ;; ;; Issue indexer name, available when ISSUE_INDEXER_TYPE is elasticsearch or meilisearch. ;ISSUE_INDEXER_NAME = gitea_issues ;; ;; Timeout the indexer if it takes longer than this to start. ;; Set to -1 to disable timeout. STARTUP_TIMEOUT = 30s ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; Repository Indexer settings ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; ;; repo indexer by default disabled, since it uses a lot of disk space REPO_INDEXER_ENABLED = true ;; ;; repo indexer units, the items to index, could be `sources`, `forks`, `mirrors`, `templates` or any combination of them separated by a comma. ;; If empty then it defaults to `sources` only, as if you'd like to disable fully please see REPO_INDEXER_ENABLED. REPO_INDEXER_REPO_TYPES = sources,forks,mirrors,templates ;; ;; Code search engine type, could be `bleve` or `elasticsearch`. REPO_INDEXER_TYPE = bleve ;; ;; Index file used for code search. available when `REPO_INDEXER_TYPE` is bleve REPO_INDEXER_PATH = /home/gitea/data/indexers/repos.bleve ;; ;; Code indexer connection string, available when `REPO_INDEXER_TYPE` is elasticsearch. i.e. http://elastic:changeme@localhost:9200 ;REPO_INDEXER_CONN_STR = ;; ;; Code indexer name, available when `REPO_INDEXER_TYPE` is elasticsearch ;REPO_INDEXER_NAME = gitea_codes ;; ;; A comma separated list of glob patterns (see https://github.com/gobwas/glob) to include ;; in the index; default is empty ;REPO_INDEXER_INCLUDE = ;; ;; A comma separated list of glob patterns to exclude from the index; ; default is empty ;REPO_INDEXER_EXCLUDE = ;; REPO_INDEXER_EXCLUDE_VENDORED = false ;MAX_FILE_SIZE = 1048576 ;; ;; Bleve engine has performance problems with fuzzy search, so we limit the fuzziness to 0 by default to disable it. ;; If you'd like to enable it, you can set it to a value between 0 and 2. ;TYPE_BLEVE_MAX_FUZZINESS = 0 ```
Author
Owner

@lunny commented on GitHub (Jun 9, 2025):

-;[indexer]
+[indexer]
@lunny commented on GitHub (Jun 9, 2025): ```diff -;[indexer] +[indexer] ```
Author
Owner

@danieldemus commented on GitHub (Jun 9, 2025):

Thank you. Seems a bit obvious, now that you point it out. 😱 😩

@danieldemus commented on GitHub (Jun 9, 2025): Thank you. Seems a bit obvious, now that you point it out. 😱 😩
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/gitea#14576