-
Notifications
You must be signed in to change notification settings - Fork 778
Indexer configuration
This is a list of the most common configuration options with their defaults which are not available as an indexer switch. These options are particularly handy when working with https://github.com/oracle/opengrok/wiki/Read-only-configuration
Tunable | Type | Meaning |
---|---|---|
fetchHistoryWhenNotInCache |
boolean |
avoid generating history for individual files when indexing. This prevents excess commands if the history log for top-level directory of a project cannot be retrieved for some reason (e.g. the command to get the history log fails) at the cost of not having history for given project available (if projects are enabled). This is specific to SCMs that can generate history for directories (e.g. Mercurial, Git, ...). |
ctags |
String |
path to Universal ctags binary. If the path is not specified in configuration, the system path will be searched and if no Universal ctags binary is found, the system property org.opengrok.indexer.analysis.Ctags will be checked and will be used if non empty. |
ctagsTimeout |
long |
timeout in seconds for processing of a file by the ctags program; if the definitions are not returned within this timeout the ctags process is terminated, default 10 seconds |
disabledRepositories |
list of disabled repository types | disable given repository types. This can also be set with the --disableRepository Indexer option. When setting this up in configuration, use the add method for strings. |
indexerCommandTimeout |
int (seconds) | timeout of external commands executed during indexing (since version 1.4.4) |
indexingParallelism |
int | number of threads to create in the second phase of indexing when actual index is created. Can be also set via -T indexer option. Directly influences number of spawned ctags processes (one for each indexer thread). |
historyParallelism |
int | number of threads to create in the first phase of indexing when history cache is generated (i.e. if -H indexer option is used). These threads usually spawn a SCM command such as git log . |
historyRenamedParallelism |
int | number of threads to create when storing history of renamed files (--renamedHistory on indexer option). These are created next to the general history handling threads; so there can be maximum historyParallelism + historyRenamedParallelism threads in total during the second phase of indexing (again, assumes -H ). These threads usually spawn a SCM command such as git log . |
indexerAuthenticationToken |
string | API token to use when performing API calls to the web application (e.g. when uploading the new configuration at end of the indexing when running with the -U command line option). Alternatively one can use the --token command line option. Complements the authenticationTokens configuration option for the web app side. |
Use the types from the table e.g. as follows:
<!-- Sample for setCtagsTimeout. Default is 10 -->
<void property="ctagsTimeout">
<long>11</long>
</void>
The username/password for Subversion repositories is set via environment variables:
OPENGROK_SUBVERSION_USERNAME
OPENGROK_SUBVERSION_PASSWORD
These are common for all Subversion repositories. They will most probably need to be set for the web application as well.
To make ctags recognize additional symbols/definitions/etc. it is possible to specify configuration file with extra configuration options for ctags.
This can be done by using the -o
Indexer option.
Sample configuration file for Solaris code base:
--regex-asm=/^[ \t]*(ENTRY_NP|ENTRY|RTENTRY)+\(([a-zA-Z0-9_]+)\)/\2/f,function/
--regex-asm=/^[ \t]*ENTRY2\(([a-zA-Z0-9_]+),[ ]*([a-zA-Z0-9_]+)\)/\1/f,function/
--regex-asm=/^[ \t]*ENTRY2\(([a-zA-Z0-9_]+),[ ]*([a-zA-Z0-9_]+)\)/\2/f,function/
--regex-asm=/^[ \t]*ENTRY_NP2\(([a-zA-Z0-9_]+),[ ]*([a-zA-Z0-9_]+)\)/\1/f,function/
--regex-asm=/^[ \t]*ENTRY_NP2\(([a-zA-Z0-9_]+),[ ]*([a-zA-Z0-9_]+)\)/\2/f,function/
Use the -A
Indexer option, e.g. to make files with the .cs
suffix to be processed as plain text:
-A .cs:org.opengrok.indexer.analysis.plain.PlainAnalyzerFactory
This will map extension .cs
to the analyzer created by the PlainAnalyzerFactory
. You should even be able to override OpenGroks analyzers using this option.
OpenGrok also allows using just the prefix. E.g. the following are all equivalent:
-A .e:org.opengrok.indexer.analysis.c.CAnalyzerFactory
-A .e:CAnalyzerFactory
-A .e:CAnalyzer
-A .e:C
To clear the mapping:
-A .e:-
so that the plain-text heuristic is active as a fallback for .e
files. Or you could explicitly map the PlainAnalyzerFactory
:
-A .e:Plain
(N.b. the case-sensitivity of the class name.)