help.jsp revision 2c72062cb1af7c20ea5bb2b736710f9e4b370962
70N/A<%--
70N/ACDDL HEADER START
286N/A
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/A
70N/ASee LICENSE.txt included in this distribution for the specific
70N/Alanguage governing permissions and limitations under the License.
70N/A
70N/AWhen distributing Covered Code, include this CDDL HEADER in each
70N/Afile and include the License file at LICENSE.txt.
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/A
70N/ACDDL HEADER END
70N/A
70N/ACopyright 2007 Sun Microsystems, Inc. All rights reserved.
70N/AUse is subject to license terms.
70N/A
70N/APortions Copyright 2011 Jens Elkner.
70N/A
70N/A--%><%@ page session="false" errorPage="error.jsp" import="
70N/Aorg.opensolaris.opengrok.web.PageConfig"
70N/A%><%
70N/A/* ---------------------- help.jsp start --------------------- */
70N/A{
70N/A cfg = PageConfig.get(request);
70N/A cfg.setTitle("OpenGrok Help");
434N/A%><%@
70N/A
70N/Ainclude file="httpheader.jspf"
70N/A
359N/A%>
359N/A<body>
359N/A <div id="page">
98N/A <div id="whole_header">
321N/A <div id="header"><%@
321N/A
213N/Ainclude file="pageheader.jspf"
304N/A
425N/A %></div>
425N/A <div id="Masthead"></div>
325N/A </div>
320N/A <div id="sbar">
332N/A <div id="menu"><%@
231N/A
98N/Ainclude file="menu.jspf"
347N/A
346N/A%>
425N/A </div>
324N/A </div>
347N/A <div id="help">
310N/A<p>
316N/A
290N/A<dfn><b>Examples:</b></dfn>
332N/A<pre class="example">
332N/A
332N/ATo find where setResourceMonitors is defined:
210N/A<a href="search?q=&amp;defs=setResourceMonitors">defs:setResourceMonitors</a>
128N/A
414N/ATo find files that use sprintf in usr/src/cmd/cmd-inet/usr.sbin/:
326N/A<a href="search?refs=sprintf&amp;path=usr%2Fsrc%2Fcmd%2Fcmd-inet%2Fusr.sbin%2F"
335N/A>refs:sprintf path:usr/src/cmd/cmd-inet/usr.sbin</a>
425N/A
370N/ATo find assignments to variable foo:
70N/A<a href="search?q=%22foo+%3D%22">"foo ="</a>
400N/A
294N/ATo find Makefiles where pstack binary is being built:
98N/A<a href="search?q=pstack&amp;path=Makefile">pstack path:Makefile</a>
434N/A
277N/Ato search for phrase "Bill Joy":
433N/A<a href="search?q=%22Bill+Joy%22">"Bill Joy"</a>
356N/A
289N/ATo find perl files that do not use /usr/bin/perl but something else:
326N/A<a href="search?q=-%22%2Fusr%2Fbin%2Fperl%22+%2B%22%2Fbin%2Fperl%22"
290N/A>-"/usr/bin/perl" +"/bin/perl"</a>
424N/A
286N/ATo find all strings beginning with foo use the wildcard:
90N/A<a href="search?q=foo*">foo*</a>
295N/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>
262N/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>
332N/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</pre>
280N/A<br/>
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<ul>
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>
98N/A</ul>
156N/A<p>A clause may be either:</p>
156N/A<ul>
98N/A <li>a <dfn>term</dfn>, indicating all the documents that contain this term;
70N/A or</li>
70N/A <li>a <dfn>phrase</dfn> - group of words surrounded by double quotes
70N/A <b>" "</b>, e.g. "hello dolly" </li>
70N/A <li>a nested query, enclosed in parentheses "<b>(</b>" "<b>)</b>" (also
70N/A called query/field <dfn>grouping</dfn>) . Note that this may be used
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>&amp;&amp;</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</ul>
70N/A<p>Regular Expression, Wildcard, Fuzzy, Proximity &amp; Range Searches:</p>
70N/A<ul>
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 More info can be found on <a href="http://lucene.apache.org/core/4_5_1/core/org/apache/lucene/util/automaton/RegExp.html?is-external=true">lucene regexp page</a>.
70N/A </li>
70N/A <li>to perform a single character wildcard search use the "<b>?</b>" symbol,
70N/A e.g. te?t</li>
253N/A <li>to perform a multiple character wildcard search use the "<b>*</b>"
70N/A symbol, e.g. test* or te*t</li>
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>
</ul>
<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>+ - &amp;&amp; || ! ( ) { } [ ] ^ " ~ * ? : \ / </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>
<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
"spaces/whitespace" (so even if you escape them, they will not be found, since
most analyzers ignore them). <br/>
The exceptions are: <b>@ $ % ^ &amp; = ? . :</b> which are mostly indexed as
separate words.<br/>
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>
<p>valid <dfn>FIELDs</dfn> are</p>
<dl class="fields">
<dt>full</dt>
<dd>Search through all text tokens (words,strings,identifiers,numbers) in index.</dd>
<dt>defs</dt>
<dd>Only finds symbol definitions (where e.g. a variable (function, ...) is defined).</dd>
<dt>refs</dt>
<dd>Only finds symbols (e.g. methods, classes, functions, variables).</dd>
<dt>path</dt>
<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>
<dt>hist</dt>
<dd>History log comments.</dd>
<dt>type</dt>
<dd>Type of analyzer used to scope down to certain file types (e.g. just C sources).<br/>Current mappings: <%=SearchHelper.getFileTypeDescirptions().toString()%></dd>
</dl>
<p>
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
</p>
<p>Opengrok search is powered by <a href="http://lucene.apache.org/"
>lucene</a>, for more detail on query syntax refer to <a href="http://lucene.apache.org/core/4_10_1/queryparser/org/apache/lucene/queryparser/classic/package-summary.html#package_description">lucene docs</a>.<br>
</p>
</div>
<%
}
/* ---------------------- help.jsp end --------------------- */
%><%@
include file="foot.jspf"
%>