mirror of
https://codeberg.org/forgejo/docs.git
synced 2024-11-24 18:09:26 -05:00
admin: Document fallback behavior of repo indexer (#444)
ref: https://codeberg.org/forgejo/forgejo/pulls/1594 Preview: https://forgejo.codeberg.page/@docs_pull_444/docs/next/user/code-search/ Reviewed-on: https://codeberg.org/forgejo/docs/pulls/444 Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org> Co-authored-by: Shiny Nematoda <snematoda@noreply.codeberg.org> Co-committed-by: Shiny Nematoda <snematoda@noreply.codeberg.org>
This commit is contained in:
parent
42d27fe502
commit
6cc672040b
3 changed files with 18 additions and 1 deletions
|
@ -464,7 +464,7 @@ relation to port exhaustion.
|
|||
- `ISSUE_INDEXER_NAME`: **gitea_issues**: Issue indexer name, available when ISSUE_INDEXER_TYPE is elasticsearch or meilisearch.
|
||||
- `ISSUE_INDEXER_PATH`: **indexers/issues.bleve**: Index file used for issue search; available when ISSUE*INDEXER_TYPE is bleve and elasticsearch. Relative paths will be made absolute against *`AppWorkPath`\_.
|
||||
|
||||
- `REPO_INDEXER_ENABLED`: **false**: Enables code search (uses a lot of disk space, about 6 times more than the repository size).
|
||||
- `REPO_INDEXER_ENABLED`: **false**: Enables code search (uses a lot of disk space, about 6 times more than the repository size). If disabled, code search will be limited within a single repository.
|
||||
- `REPO_INDEXER_REPO_TYPES`: **sources,forks,mirrors,templates**: 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_TYPE`: **bleve**: Code search engine type, could be `bleve` or `elasticsearch`.
|
||||
- `REPO_INDEXER_PATH`: **indexers/repos.bleve**: Index file used for code search.
|
||||
|
|
16
docs/user/code-search.md
Normal file
16
docs/user/code-search.md
Normal file
|
@ -0,0 +1,16 @@
|
|||
---
|
||||
title: 'Code Search'
|
||||
license: 'CC-BY-SA-4.0'
|
||||
---
|
||||
|
||||
Forgejo supports code search through an indexer and `git-grep` as a fallback when [`REPO_INDEXER_ENABLED`](../../admin/config-cheat-sheet#indexer-indexer) is disabled.
|
||||
|
||||
# Basic (git-grep)
|
||||
|
||||
If `REPO_INDEXER_ENABLED` is set to `false`, the code search function will be limited to a single repository and will use [`git-grep`](https://git-scm.com/docs/git-grep).
|
||||
|
||||
Currently, only fixed strings are supported and any case differences are ignored. The search results will include the matched line, as well as a single line before and after the match. The search query will be executed on the default branch of the repository.
|
||||
|
||||
# Indexer
|
||||
|
||||
For advanced search queries and searching across an entire organisation or instance, `REPO_INDEXER_ENABLED: true` enables code search via bleve/elasticsearch.
|
|
@ -35,6 +35,7 @@ involved in running it on their machines.
|
|||
- [Merge Message templates](./merge-message-templates/)
|
||||
- [Webhooks](./webhooks/)
|
||||
- [Programming language detection](./language-detection/)
|
||||
- [Code Search](./code-search/)
|
||||
- Authentication
|
||||
- [Generating an Access Token](https://docs.codeberg.org/advanced/access-token/)
|
||||
- [Access Token scope](./token-scope/)
|
||||
|
|
Loading…
Reference in a new issue