70N/AThe contents of this file are subject to the terms of the
70N/ACommon Development and Distribution License (the "License").
70N/AYou may not use this file except in compliance with the License.
70N/Alanguage governing permissions and limitations under the License.
70N/AWhen distributing Covered Code, include this CDDL HEADER in each
70N/AIf applicable, add the following below this CDDL HEADER, with the
70N/Afields enclosed by brackets "[]" replaced with your own identifying
70N/Ainformation: Portions Copyright [yyyy] [name of copyright owner]
70N/ACopyright 2007 Sun Microsystems, Inc. All rights reserved.
70N/AUse is subject to license terms.
70N/APortions Copyright 2011 Jens Elkner.
70N/A/* ----------------------
help.jsp start --------------------- */
98N/A <div id="whole_header">
425N/A <div id="Masthead"></div>
290N/A<dfn><b>Examples:</b></dfn>
332N/ATo find where setResourceMonitors is defined:
210N/A<a href="search?q=&defs=setResourceMonitors">defs:setResourceMonitors</a>
326N/A<a href="search?refs=sprintf&path=usr%2Fsrc%2Fcmd%2Fcmd-inet%
2Fusr.sbin%2F"
370N/ATo find assignments to variable foo:
70N/A<a href="search?q=%22foo+%3D%22">"foo ="</a>
294N/ATo find Makefiles where pstack binary is being built:
98N/A<a href="search?q=pstack&path=Makefile">pstack path:Makefile</a>
277N/Ato search for phrase "Bill Joy":
433N/A<a href="search?q=%22Bill+Joy%22">"Bill Joy"</a>
326N/A<a href="search?q=-%22%2Fusr%2Fbin%2Fperl%22+%2B%22%2Fbin%2Fperl%22"
286N/ATo find all strings beginning with foo use the wildcard:
90N/A<a href="search?q=foo*">foo*</a>
70N/ATo find all files which have . c in their name (dot is a token!):
299N/A<a href="search?path=%22. c%22">". c"</a>
277N/ATo find all files which start with "ma" and then have only alphabet characters do:
332N/A<a href="search?path=/ma[a-zA-Z]*/">path:/ma[a-zA-Z]*/</a>
70N/ATo find all main methods in all files analyzed by C analyzer (so .c, .h, ...) do:
70N/A<a href="search?q=main&type=c">main type:c</a>
319N/A<dfn><b>More info:</b></dfn><br/><br/>
359N/AA <dfn>Query</dfn> is a series of clauses. A clause may be prefixed by:</p>
418N/A <li>a plus "<b>+</b>" or a minus "<b>-</b>" sign, indicating that the clause
70N/A is required or prohibited respectively; or</li>
98N/A <li>a <dfn>term</dfn> followed by a colon "<b>:</b>", indicating the
98N/A <dfn>field</dfn> to be searched. This enables one to construct queries
414N/A which search multiple <dfn>fields</dfn>.</li>
156N/A<p>A clause may be either:</p>
98N/A <li>a <dfn>term</dfn>, indicating all the documents that contain this term;
70N/A <li>a <dfn>phrase</dfn> - group of words surrounded by double quotes
70N/A <li>a nested query, enclosed in parentheses "<b>(</b>" "<b>)</b>" (also
70N/A with a +/- prefix to require any of a set of terms. </li>
70N/A <li>boolean <dfn>operators</dfn> which allow terms to be combined through
70N/A logic operators. Supported are <b>AND</b>(<b>&&</b>), "<b>+</b>",
70N/A <b>OR</b>(<b>||</b>), <b>NOT</b>(<b>!</b>) and "<b>-</b>" (Note: they
70N/A must be ALL CAPS).</li>
70N/A<p>Regular Expression, Wildcard, Fuzzy, Proximity & Range Searches:</p>
70N/A <li>to perform a regular expression search use the "<b>/</b>" enclosure,
380N/A e.g. /[mb]an/ - will search for man or for ban;<br>
380N/A NOTE: path field search escapes "/" by default, so it only supports
380N/A regexps when the search string <u>starts and ends</u> with "/".<br>
70N/A <li>to perform a single character wildcard search use the "<b>?</b>" symbol,
253N/A <li>to perform a multiple character wildcard search use the "<b>*</b>"
70N/A <li>you can use a * or ? symbol as the first character of a search
(unless not enabled using indexer option -a).</li>
<li>to do a fuzzy search (find words similar in spelling, based on the
Levenshtein Distance, or Edit Distance algorithm) use the tilde,
"<b>~</b>",
e.g. rcs~ </li>
<li>to do a proximity search use the tilde, "~", symbol at the end of a
Phrase. For example to search for a "opengrok" and "help" within 10
words of each other enter: "opengrok help"~10 </li>
<li>range queries allow one to match documents whose field(s) values are
between the lower and upper bound specified by the Range Query. Range
Queries can be inclusive or exclusive of the upper and lower bounds.
Sorting is done lexicographically. Inclusive queries are denoted by
square brackets <b>[ ]</b> , exclusive by curly brackets <b>{ }</b>.
For example: title:{Aida TO Carmen} - will find all documents between
Aida to Carmen, exclusive of Aida and Carmen. </li>
<a id="escaping"><dfn>Escaping special characters:</dfn></a>
<p>Opengrok supports escaping special characters that are part of the query
syntax. Current special characters are:<br/>
<b>+ - && || ! ( ) { } [ ] ^ " ~ * ? : \ / </b><br/>
To escape these character use the \ before the character. For example to search
for <b>(1+1):2</b> use the query: <b>\(1\+1\)\:2</b>
<p>NOTE on analyzers: Indexed words are made up of Alpha-Numeric and Underscore
characters. One letter words are usually not indexed as symbols!<br/>
Most other characters (including single and double quotes) are treated as
most analyzers ignore them). <br/>
The exceptions are: <b>@ $ % ^ & = ? . :</b> which are mostly indexed as
Because some of them are part of the query syntax, they must be escaped with a
reverse slash as noted above.<br/>
So searching for <b>\+1</b> or <b>\+ 1</b> will both find <b>+1</b> and <b>+ 1</b>.
<p>valid <dfn>FIELDs</dfn> are</p>
<dd>Search through all text tokens (words,strings,identifiers,numbers) in index.</dd>
<dd>Only finds symbol definitions (where
e.g. a variable (function, ...) is defined).</dd>
<dd>Only finds symbols (
e.g. methods, classes, functions, variables).</dd>
<dd>path of the source file (no need to use dividers, or if, then use "/" - Windows users, "\" is an escape key in lucene query syntax! <br/>Please don't use "\", or replace it with "/").<br/>Also note that if you want just exact path, enclose it in "",
e.g. "
src/mypath", otherwise dividers will be removed and you get more hits.</dd>
<dd>History log comments.</dd>
the term (phrases) can be boosted (making it more relevant) using a caret
<b>^</b> ,
e.g. help^4 opengrok - will make term help boosted
/* ----------------------
help.jsp end --------------------- */