A Query is a series of clauses. A clause may be prefixed by:

A clause may be either:

Wildcard, Fuzzy, Proximity & Range Searches:

Escaping special characters:

Opengrok supports escaping special characters that are part of the query syntax. Current special characters are:
+ - && || ! ( ) { } [ ] ^ " ~ * ? : \
To escape these character use the \ before the character. For example to search for (1+1):2 use the query: \(1\+1\)\:2

NOTE on analyzers: Indexed words are made up of Alpha-Numeric and Underscore characters. One letter words are usually not indexed as symbols!
Most other characters(including single and double quotes) are treated as "spaces/whitespace"(so even if you escape them, they will not be found, since most analyzers ignore them).
The exceptions are: @ $ % ^ & = ? . : which are mostly indexed as separate words.
Because some of them are part of the query syntax, they must be escaped with a reverse slash as noted above.
So searching for \+1 or \+ 1 will both find +1 and + 1.

valid FIELDs are

full
Search through all text tokens(words,strings,identifiers,numbers) in index.
defs
Only finds symbol definitions.
refs
Only finds symbols.
path
path of the source file.
hist
History log comments.

the term(phrases) can be boosted (making it more relevant) using a caret ^ , e.g. help^4 opengrok - will make term help boosted

Examples:

To find where setResourceMonitors is defined: defs:setResourceMonitors

To find files that use sprintf in usr/src/cmd/cmd-inet/usr.sbin/:
refs:sprintf path:usr/src/cmd/cmd-inet/usr.sbin

To find assignments to variable Asign:
"Asign="

To find Makefiles where pstack binary is being built:
pstack path:Makefile

to search for phrase "Bill Joy":
"Bill Joy"

To find perl files that do not use /usr/bin/perl but something else:
-"/usr/bin/perl" +"/bin/perl"

To find all strings begining with foo use the wildcard:
foo*

To find all files which have . c in their name(dot is a token!):
". c"

Opengrok search is powered by lucene, for more detail on query syntax refer to lucene docs.