help.jsp revision 60281ca3d1db22f5d2204e1be4975504853072a7
ab2c1c1c83ec91415565da5a71fbc15d9685caa6fieldingCDDL HEADER START
bc8fd1b0b1afdf89b8d28eefa8cd74e26ba97986fieldingThe contents of this file are subject to the terms of the
ab2c1c1c83ec91415565da5a71fbc15d9685caa6fieldingCommon Development and Distribution License (the "License").
0f081398cf0eef8cc7c66a535d450110a92dc8aefieldingYou may not use this file except in compliance with the License.
0f081398cf0eef8cc7c66a535d450110a92dc8aefieldingSee LICENSE.txt included in this distribution for the specific
0f081398cf0eef8cc7c66a535d450110a92dc8aefieldinglanguage governing permissions and limitations under the License.
0f081398cf0eef8cc7c66a535d450110a92dc8aefieldingWhen distributing Covered Code, include this CDDL HEADER in each
ab2c1c1c83ec91415565da5a71fbc15d9685caa6fieldingfile and include the License file at LICENSE.txt.
0f081398cf0eef8cc7c66a535d450110a92dc8aefieldingIf applicable, add the following below this CDDL HEADER, with the
0f081398cf0eef8cc7c66a535d450110a92dc8aefieldingfields enclosed by brackets "[]" replaced with your own identifying
0f081398cf0eef8cc7c66a535d450110a92dc8aefieldinginformation: Portions Copyright [yyyy] [name of copyright owner]
0f081398cf0eef8cc7c66a535d450110a92dc8aefieldingCDDL HEADER END
ab2c1c1c83ec91415565da5a71fbc15d9685caa6fieldingCopyright 2007 Sun Microsystems, Inc. All rights reserved.
ab2c1c1c83ec91415565da5a71fbc15d9685caa6fieldingUse is subject to license terms.
ab2c1c1c83ec91415565da5a71fbc15d9685caa6fieldingPortions Copyright 2011 Jens Elkner.
ab2c1c1c83ec91415565da5a71fbc15d9685caa6fielding--%><%@ page session="false" errorPage="error.jsp" import="
ab2c1c1c83ec91415565da5a71fbc15d9685caa6fielding/* ---------------------- help.jsp start --------------------- */
ab2c1c1c83ec91415565da5a71fbc15d9685caa6fielding cfg = PageConfig.get(request);
0f081398cf0eef8cc7c66a535d450110a92dc8aefielding cfg.setTitle("OpenGrok Help");
64185f9824e42f21ca7b9ae6c004484215c031a7rbbinclude file="httpheader.jspf"
ab2c1c1c83ec91415565da5a71fbc15d9685caa6fielding <div id="page">
ab2c1c1c83ec91415565da5a71fbc15d9685caa6fielding <div id="whole_header">
ab2c1c1c83ec91415565da5a71fbc15d9685caa6fielding <div id="header"><%@
ab2c1c1c83ec91415565da5a71fbc15d9685caa6fielding <div id="Masthead"></div>
ab2c1c1c83ec91415565da5a71fbc15d9685caa6fielding <div id="sbar">
0f081398cf0eef8cc7c66a535d450110a92dc8aefielding <div id="menu"><%@
0f081398cf0eef8cc7c66a535d450110a92dc8aefieldinginclude file="menu.jspf"
ab2c1c1c83ec91415565da5a71fbc15d9685caa6fielding <div id="help">
ab2c1c1c83ec91415565da5a71fbc15d9685caa6fieldingA <dfn>Query</dfn> is a series of clauses. A clause may be prefixed by:</p>
0f081398cf0eef8cc7c66a535d450110a92dc8aefielding <li>a plus "<b>+</b>" or a minus "<b>-</b>" sign, indicating that the clause
0f081398cf0eef8cc7c66a535d450110a92dc8aefielding is required or prohibited respectively; or</li>
0f081398cf0eef8cc7c66a535d450110a92dc8aefielding <li>a <dfn>term</dfn> followed by a colon "<b>:</b>", indicating the
0f081398cf0eef8cc7c66a535d450110a92dc8aefielding <dfn>field</dfn> to be searched. This enables one to construct queries
0f081398cf0eef8cc7c66a535d450110a92dc8aefielding which search multiple <dfn>fields</dfn>.</li>
0f081398cf0eef8cc7c66a535d450110a92dc8aefielding<p>A clause may be either:</p>
0f081398cf0eef8cc7c66a535d450110a92dc8aefielding <li>a <dfn>term</dfn>, indicating all the documents that contain this term;
0f081398cf0eef8cc7c66a535d450110a92dc8aefielding <li>a <dfn>phrase</dfn> - group of words surrounded by double quotes
0f081398cf0eef8cc7c66a535d450110a92dc8aefielding <b>" "</b>, e.g. "hello dolly" </li>
0f081398cf0eef8cc7c66a535d450110a92dc8aefielding <li>a nested query, enclosed in parentheses "<b>(</b>" "<b>)</b>" (also
0f081398cf0eef8cc7c66a535d450110a92dc8aefielding called query/field <dfn>grouping</dfn>) . Note that this may be used
0f081398cf0eef8cc7c66a535d450110a92dc8aefielding with a +/- prefix to require any of a set of terms. </li>
0f081398cf0eef8cc7c66a535d450110a92dc8aefielding <li>boolean <dfn>operators</dfn> which allow terms to be combined through
0f081398cf0eef8cc7c66a535d450110a92dc8aefielding logic operators. Supported are <b>AND</b>(<b>&&</b>), "<b>+</b>",
0f081398cf0eef8cc7c66a535d450110a92dc8aefielding <b>OR</b>(<b>||</b>), <b>NOT</b>(<b>!</b>) and "<b>-</b>" (Note: they
0f081398cf0eef8cc7c66a535d450110a92dc8aefielding must be ALL CAPS).</li>
0f081398cf0eef8cc7c66a535d450110a92dc8aefielding<p>Regular Expression, Wildcard, Fuzzy, Proximity & Range Searches:</p>
0f081398cf0eef8cc7c66a535d450110a92dc8aefielding <li>to perform a regular expression search use the "<b>/</b>" enclosure,
0f081398cf0eef8cc7c66a535d450110a92dc8aefielding e.g. /[mb]an/ - will search for man or for ban;<br>
0f081398cf0eef8cc7c66a535d450110a92dc8aefielding NOTE: path field search escapes "/" by default, so it only supports
0f081398cf0eef8cc7c66a535d450110a92dc8aefielding regexps when the search string <u>starts and ends</u> with "/".<br>
0f081398cf0eef8cc7c66a535d450110a92dc8aefielding More info can be found on <a href="http://lucene.apache.org/core/4_3_0/core/org/apache/lucene/util/automaton/RegExp.html?is-external=true">lucene regexp page</a>.
0f081398cf0eef8cc7c66a535d450110a92dc8aefielding <li>to perform a single character wildcard search use the "<b>?</b>" symbol,
0f081398cf0eef8cc7c66a535d450110a92dc8aefielding <li>to perform a multiple character wildcard search use the "<b>*</b>"
0f081398cf0eef8cc7c66a535d450110a92dc8aefielding symbol, e.g. test* or te*t</li>
0f081398cf0eef8cc7c66a535d450110a92dc8aefielding <li>you can use a * or ? symbol as the first character of a search
0f081398cf0eef8cc7c66a535d450110a92dc8aefielding (unless not enabled using indexer option -a).</li>
0f081398cf0eef8cc7c66a535d450110a92dc8aefielding <li>to do a fuzzy search(find words similar in spelling, based on the
0f081398cf0eef8cc7c66a535d450110a92dc8aefielding Levenshtein Distance, or Edit Distance algorithm) use the tilde,
0f081398cf0eef8cc7c66a535d450110a92dc8aefielding "<b>~</b>", e.g. rcs~ </li>
0f081398cf0eef8cc7c66a535d450110a92dc8aefielding <li>to do a proximity search use the tilde, "~", symbol at the end of a
0f081398cf0eef8cc7c66a535d450110a92dc8aefielding Phrase. For example to search for a "opengrok" and "help" within 10
0f081398cf0eef8cc7c66a535d450110a92dc8aefielding words of each other enter: "opengrok help"~10 </li>
0f081398cf0eef8cc7c66a535d450110a92dc8aefielding <li>range queries allow one to match documents whose field(s) values are
0f081398cf0eef8cc7c66a535d450110a92dc8aefielding between the lower and upper bound specified by the Range Query. Range
0f081398cf0eef8cc7c66a535d450110a92dc8aefielding Queries can be inclusive or exclusive of the upper and lower bounds.
0f081398cf0eef8cc7c66a535d450110a92dc8aefielding Sorting is done lexicographically. Inclusive queries are denoted by
0f081398cf0eef8cc7c66a535d450110a92dc8aefielding square brackets <b>[ ]</b> , exclusive by curly brackets <b>{ }</b>.
0f081398cf0eef8cc7c66a535d450110a92dc8aefielding For example: title:{Aida TO Carmen} - will find all documents between
0f081398cf0eef8cc7c66a535d450110a92dc8aefielding Aida to Carmen, exclusive of Aida and Carmen. </li>
0f081398cf0eef8cc7c66a535d450110a92dc8aefielding<a id="escaping"><dfn>Escaping special characters:</dfn></a>
0f081398cf0eef8cc7c66a535d450110a92dc8aefielding<p>Opengrok supports escaping special characters that are part of the query
0f081398cf0eef8cc7c66a535d450110a92dc8aefielding syntax. Current special characters are:<br/>
0f081398cf0eef8cc7c66a535d450110a92dc8aefielding <b>+ - && || ! ( ) { } [ ] ^ " ~ * ? : \ / </b><br/>
0f081398cf0eef8cc7c66a535d450110a92dc8aefieldingTo escape these character use the \ before the character. For example to search
0f081398cf0eef8cc7c66a535d450110a92dc8aefieldingfor <b>(1+1):2</b> use the query: <b>\(1\+1\)\:2</b>
0f081398cf0eef8cc7c66a535d450110a92dc8aefielding<p>NOTE on analyzers: Indexed words are made up of Alpha-Numeric and Underscore
0f081398cf0eef8cc7c66a535d450110a92dc8aefieldingcharacters. One letter words are usually not indexed as symbols!<br/>
0f081398cf0eef8cc7c66a535d450110a92dc8aefieldingMost other characters(including single and double quotes) are treated as
0f081398cf0eef8cc7c66a535d450110a92dc8aefielding"spaces/whitespace"(so even if you escape them, they will not be found, since
0f081398cf0eef8cc7c66a535d450110a92dc8aefieldingmost analyzers ignore them). <br/>
0f081398cf0eef8cc7c66a535d450110a92dc8aefieldingThe exceptions are: <b>@ $ % ^ & = ? . :</b> which are mostly indexed as
0f081398cf0eef8cc7c66a535d450110a92dc8aefieldingseparate words.<br/>
0f081398cf0eef8cc7c66a535d450110a92dc8aefieldingBecause some of them are part of the query syntax, they must be escaped with a
0f081398cf0eef8cc7c66a535d450110a92dc8aefieldingreverse slash as noted above.<br/>
0f081398cf0eef8cc7c66a535d450110a92dc8aefieldingSo searching for <b>\+1</b> or <b>\+ 1</b> will both find <b>+1</b> and <b>+ 1</b>.
0f081398cf0eef8cc7c66a535d450110a92dc8aefielding<p>valid <dfn>FIELDs</dfn> are</p>
0f081398cf0eef8cc7c66a535d450110a92dc8aefielding <dl class="fields">
0f081398cf0eef8cc7c66a535d450110a92dc8aefielding<dt>full</dt>
0f081398cf0eef8cc7c66a535d450110a92dc8aefielding<dd>Search through all text tokens(words,strings,identifiers,numbers) in index.</dd>
0f081398cf0eef8cc7c66a535d450110a92dc8aefielding<dt>defs</dt>
0f081398cf0eef8cc7c66a535d450110a92dc8aefielding<dd>Only finds symbol definitions.</dd>
0f081398cf0eef8cc7c66a535d450110a92dc8aefielding<dt>refs</dt>
0f081398cf0eef8cc7c66a535d450110a92dc8aefielding<dd>Only finds symbols.</dd>
0f081398cf0eef8cc7c66a535d450110a92dc8aefielding<dt>path</dt>
0f081398cf0eef8cc7c66a535d450110a92dc8aefielding<dd>path of the source file.</dd>
0f081398cf0eef8cc7c66a535d450110a92dc8aefielding<dt>hist</dt>
0f081398cf0eef8cc7c66a535d450110a92dc8aefielding<dd>History log comments.</dd>
0f081398cf0eef8cc7c66a535d450110a92dc8aefieldingthe term(phrases) can be boosted (making it more relevant) using a caret
0f081398cf0eef8cc7c66a535d450110a92dc8aefielding<b>^</b> , e.g. help^4 opengrok - will make term help boosted
0f081398cf0eef8cc7c66a535d450110a92dc8aefielding<dfn><b>Examples:</b></dfn>
0f081398cf0eef8cc7c66a535d450110a92dc8aefielding<pre class="example">
0f081398cf0eef8cc7c66a535d450110a92dc8aefieldingTo find where setResourceMonitors is defined:
0f081398cf0eef8cc7c66a535d450110a92dc8aefielding<a href="search?q=&defs=setResourceMonitors">defs:setResourceMonitors</a>
0f081398cf0eef8cc7c66a535d450110a92dc8aefieldingTo find files that use sprintf in usr/src/cmd/cmd-inet/usr.sbin/:
0f081398cf0eef8cc7c66a535d450110a92dc8aefielding<a href="search?refs=sprintf&path=usr%2Fsrc%2Fcmd%2Fcmd-inet%2Fusr.sbin%2F"
0f081398cf0eef8cc7c66a535d450110a92dc8aefielding>refs:sprintf path:usr/src/cmd/cmd-inet/usr.sbin</a>
0f081398cf0eef8cc7c66a535d450110a92dc8aefieldingTo find assignments to variable foo:
0f081398cf0eef8cc7c66a535d450110a92dc8aefielding<a href="search?q=%22foo+%3D%22">"foo ="</a>
0f081398cf0eef8cc7c66a535d450110a92dc8aefieldingTo find Makefiles where pstack binary is being built:
0f081398cf0eef8cc7c66a535d450110a92dc8aefielding<a href="search?q=pstack&path=Makefile">pstack path:Makefile</a>
0f081398cf0eef8cc7c66a535d450110a92dc8aefieldingto search for phrase "Bill Joy":
0f081398cf0eef8cc7c66a535d450110a92dc8aefielding<a href="search?q=%22Bill+Joy%22">"Bill Joy"</a>
0f081398cf0eef8cc7c66a535d450110a92dc8aefieldingTo find perl files that do not use /usr/bin/perl but something else:
0f081398cf0eef8cc7c66a535d450110a92dc8aefielding<a href="search?q=-%22%2Fusr%2Fbin%2Fperl%22+%2B%22%2Fbin%2Fperl%22"
0f081398cf0eef8cc7c66a535d450110a92dc8aefieldingTo find all strings begining with foo use the wildcard:
0f081398cf0eef8cc7c66a535d450110a92dc8aefielding<a href="search?q=foo*">sefoo*</a>
0f081398cf0eef8cc7c66a535d450110a92dc8aefieldingTo find all files which have . c in their name(dot is a token!):
0f081398cf0eef8cc7c66a535d450110a92dc8aefielding<a href="search?path=%22. c%22">". c"</a>
0f081398cf0eef8cc7c66a535d450110a92dc8aefieldingTo find all files which start with "ma" and then have only alphabet characters do:
0f081398cf0eef8cc7c66a535d450110a92dc8aefielding<a href="search?path=/ma[a-zA-Z]*/">/ma[a-zA-Z]*/</a>
0f081398cf0eef8cc7c66a535d450110a92dc8aefielding<p>Opengrok search is powered by <a href="http://lucene.apache.org/"
0f081398cf0eef8cc7c66a535d450110a92dc8aefielding>lucene</a>, for more detail on query syntax refer to <a href="http://lucene.apache.org/core/4_3_0/queryparser/org/apache/lucene/queryparser/classic/package-summary.html#package_description">lucene docs</a>.<br>
0f081398cf0eef8cc7c66a535d450110a92dc8aefielding/* ---------------------- help.jsp end --------------------- */
0f081398cf0eef8cc7c66a535d450110a92dc8aefieldinginclude file="foot.jspf"