help.jsp revision be129181c479d0994742681b1513b15c4ff2d1e2
012a352f4b26cfd874db8d06debc495c2303e8b2Bob Halley<%--
178f6ad061e54bc5babfca3577f72058fa0797c1Bob HalleyCDDL HEADER START
33cc94f04cb44dc247f605a954e45e5adc699977Automatic Updater
dafcb997e390efa4423883dafd100c975c4095d6Mark AndrewsThe contents of this file are subject to the terms of the
40f53fa8d9c6a4fc38c0014495e7a42b08f52481David LawrenceCommon Development and Distribution License (the "License").
ec5347e2c775f027573ce5648b910361aa926c01Automatic UpdaterYou may not use this file except in compliance with the License.
178f6ad061e54bc5babfca3577f72058fa0797c1Bob Halley
178f6ad061e54bc5babfca3577f72058fa0797c1Bob HalleySee LICENSE.txt included in this distribution for the specific
40f53fa8d9c6a4fc38c0014495e7a42b08f52481David Lawrencelanguage governing permissions and limitations under the License.
dafcb997e390efa4423883dafd100c975c4095d6Mark Andrews
dafcb997e390efa4423883dafd100c975c4095d6Mark AndrewsWhen distributing Covered Code, include this CDDL HEADER in each
dafcb997e390efa4423883dafd100c975c4095d6Mark Andrewsfile and include the License file at LICENSE.txt.
dafcb997e390efa4423883dafd100c975c4095d6Mark AndrewsIf applicable, add the following below this CDDL HEADER, with the
dafcb997e390efa4423883dafd100c975c4095d6Mark Andrewsfields enclosed by brackets "[]" replaced with your own identifying
dafcb997e390efa4423883dafd100c975c4095d6Mark Andrewsinformation: Portions Copyright [yyyy] [name of copyright owner]
dafcb997e390efa4423883dafd100c975c4095d6Mark Andrews
b897c52f865b2fc4e220e2110b874e59c716456bBob HalleyCDDL HEADER END
7f9f8c13c5e5e26e0ba2b82c0900d11ecf6269ceMark Andrews
9c3531d72aeaad6c5f01efe6a1c82023e1379e4dDavid LawrenceCopyright 2007 Sun Microsystems, Inc. All rights reserved.
0b72c791466d0807bcf22522b5ddb7da902c2720Bob HalleyUse is subject to license terms.
0b72c791466d0807bcf22522b5ddb7da902c2720Bob Halley
0b72c791466d0807bcf22522b5ddb7da902c2720Bob HalleyPortions Copyright 2011 Jens Elkner.
460b427411b72da26b1836b9424e2e70d65d9394David Lawrence
0b72c791466d0807bcf22522b5ddb7da902c2720Bob Halley--%><%@ page session="false" errorPage="error.jsp" import="
0b72c791466d0807bcf22522b5ddb7da902c2720Bob Halleyorg.opensolaris.opengrok.web.PageConfig"
0b72c791466d0807bcf22522b5ddb7da902c2720Bob Halley%><%
0b72c791466d0807bcf22522b5ddb7da902c2720Bob Halley/* ---------------------- help.jsp start --------------------- */
0b72c791466d0807bcf22522b5ddb7da902c2720Bob Halley{
b897c52f865b2fc4e220e2110b874e59c716456bBob Halley cfg = PageConfig.get(request);
0b72c791466d0807bcf22522b5ddb7da902c2720Bob Halley cfg.setTitle("OpenGrok Help");
0b72c791466d0807bcf22522b5ddb7da902c2720Bob Halley%><%@
0b72c791466d0807bcf22522b5ddb7da902c2720Bob Halley
0b72c791466d0807bcf22522b5ddb7da902c2720Bob Halleyinclude file="httpheader.jspf"
b897c52f865b2fc4e220e2110b874e59c716456bBob Halley
460b427411b72da26b1836b9424e2e70d65d9394David Lawrence%>
460b427411b72da26b1836b9424e2e70d65d9394David Lawrence<body>
460b427411b72da26b1836b9424e2e70d65d9394David Lawrence <div id="page">
0b72c791466d0807bcf22522b5ddb7da902c2720Bob Halley <div id="whole_header">
0b72c791466d0807bcf22522b5ddb7da902c2720Bob Halley <div id="header"><%@
460b427411b72da26b1836b9424e2e70d65d9394David Lawrence
460b427411b72da26b1836b9424e2e70d65d9394David Lawrenceinclude file="pageheader.jspf"
460b427411b72da26b1836b9424e2e70d65d9394David Lawrence
fcb54ce0a4f7377486df5bec83b3aa4711bf4131Mark Andrews %></div>
460b427411b72da26b1836b9424e2e70d65d9394David Lawrence <div id="Masthead"></div>
460b427411b72da26b1836b9424e2e70d65d9394David Lawrence </div>
460b427411b72da26b1836b9424e2e70d65d9394David Lawrence <div id="sbar">
460b427411b72da26b1836b9424e2e70d65d9394David Lawrence <div id="menu"><%@
460b427411b72da26b1836b9424e2e70d65d9394David Lawrence
0b72c791466d0807bcf22522b5ddb7da902c2720Bob Halleyinclude file="menu.jspf"
12e63bfe1d111ccb57f482b28d56c785cccc7cf7David Lawrence
12e63bfe1d111ccb57f482b28d56c785cccc7cf7David Lawrence%>
12e63bfe1d111ccb57f482b28d56c785cccc7cf7David Lawrence </div>
12e63bfe1d111ccb57f482b28d56c785cccc7cf7David Lawrence </div>
dabea86dac4c01f852b7aea728f73b4f55a89d44Mark Andrews <div id="help">
dabea86dac4c01f852b7aea728f73b4f55a89d44Mark Andrews<p>
dabea86dac4c01f852b7aea728f73b4f55a89d44Mark Andrews
2d46d268ccff30bb50e661b47c6496d23d9156c7Mark Andrews<dfn><b>Examples:</b></dfn>
2d46d268ccff30bb50e661b47c6496d23d9156c7Mark Andrews<pre class="example">
dabea86dac4c01f852b7aea728f73b4f55a89d44Mark Andrews
0b72c791466d0807bcf22522b5ddb7da902c2720Bob HalleyTo find where setResourceMonitors is defined:
12e63bfe1d111ccb57f482b28d56c785cccc7cf7David Lawrence<a href="search?q=&amp;defs=setResourceMonitors">defs:setResourceMonitors</a>
460b427411b72da26b1836b9424e2e70d65d9394David Lawrence
12e63bfe1d111ccb57f482b28d56c785cccc7cf7David LawrenceTo find files that use sprintf in usr/src/cmd/cmd-inet/usr.sbin/:
460b427411b72da26b1836b9424e2e70d65d9394David Lawrence<a href="search?refs=sprintf&amp;path=usr%2Fsrc%2Fcmd%2Fcmd-inet%2Fusr.sbin%2F"
12e63bfe1d111ccb57f482b28d56c785cccc7cf7David Lawrence>refs:sprintf path:usr/src/cmd/cmd-inet/usr.sbin</a>
460b427411b72da26b1836b9424e2e70d65d9394David Lawrence
596912ee9ca8eb14d30707ec286ab5d28bd39b3eMark AndrewsTo find assignments to variable foo:
8319af16557b81eba3277ee67215285f0823b587Mark Andrews<a href="search?q=%22foo+%3D%22">"foo ="</a>
8319af16557b81eba3277ee67215285f0823b587Mark Andrews
aee5e9cbacd8f88325840b8a498876f4319b0890Mark AndrewsTo find Makefiles where pstack binary is being built:
12e63bfe1d111ccb57f482b28d56c785cccc7cf7David Lawrence<a href="search?q=pstack&amp;path=Makefile">pstack path:Makefile</a>
460b427411b72da26b1836b9424e2e70d65d9394David Lawrence
12e63bfe1d111ccb57f482b28d56c785cccc7cf7David Lawrenceto search for phrase "Bill Joy":
460b427411b72da26b1836b9424e2e70d65d9394David Lawrence<a href="search?q=%22Bill+Joy%22">"Bill Joy"</a>
12e63bfe1d111ccb57f482b28d56c785cccc7cf7David Lawrence
c32b87bc54abacf95fb3b063d72b7d1855c1643bMichael GraffTo find perl files that do not use /usr/bin/perl but something else:
7f9f8c13c5e5e26e0ba2b82c0900d11ecf6269ceMark Andrews<a href="search?q=-%22%2Fusr%2Fbin%2Fperl%22+%2B%22%2Fbin%2Fperl%22"
460b427411b72da26b1836b9424e2e70d65d9394David Lawrence>-"/usr/bin/perl" +"/bin/perl"</a>
12e63bfe1d111ccb57f482b28d56c785cccc7cf7David Lawrence
12e63bfe1d111ccb57f482b28d56c785cccc7cf7David LawrenceTo find all strings begining with foo use the wildcard:
12e63bfe1d111ccb57f482b28d56c785cccc7cf7David Lawrence<a href="search?q=foo*">foo*</a>
460b427411b72da26b1836b9424e2e70d65d9394David Lawrence
b616f6ed69209ab4c87f610b472aeb20760652f2Mark AndrewsTo find all files which have . c in their name (dot is a token!):
0b72c791466d0807bcf22522b5ddb7da902c2720Bob Halley<a href="search?path=%22. c%22">". c"</a>
2320f230995995595438a9d9301d84931fd266ceMark Andrews
c427260a8678f2e99a2337fb95ec98d9c9ee8c05Mark AndrewsTo find all files which start with "ma" and then have only alphabet characters do:
620a452ebe92fff63e85c5930a6e6dc8d9455918Mark Andrews<a href="search?path=/ma[a-zA-Z]*/">path:/ma[a-zA-Z]*/</a>
620a452ebe92fff63e85c5930a6e6dc8d9455918Mark Andrews
6dcb47e37f9f0cdb94bdabc3fa157ff07983c590Mark AndrewsTo find all main methods in all files analyzed by C analyzer (so .c, .h, ...) do:
6dcb47e37f9f0cdb94bdabc3fa157ff07983c590Mark Andrews<a href="search?q=main&type=c">main type:c</a>
0b72c791466d0807bcf22522b5ddb7da902c2720Bob Halley</pre>
0b72c791466d0807bcf22522b5ddb7da902c2720Bob Halley<br/>
0b72c791466d0807bcf22522b5ddb7da902c2720Bob Halley<dfn><b>More info:</b></dfn><br/><br/>
0b72c791466d0807bcf22522b5ddb7da902c2720Bob HalleyA <dfn>Query</dfn> is a series of clauses. A clause may be prefixed by:</p>
0b72c791466d0807bcf22522b5ddb7da902c2720Bob Halley<ul>
0b72c791466d0807bcf22522b5ddb7da902c2720Bob Halley <li>a plus "<b>+</b>" or a minus "<b>-</b>" sign, indicating that the clause
0b72c791466d0807bcf22522b5ddb7da902c2720Bob Halley is required or prohibited respectively; or</li>
0b72c791466d0807bcf22522b5ddb7da902c2720Bob Halley <li>a <dfn>term</dfn> followed by a colon "<b>:</b>", indicating the
0b72c791466d0807bcf22522b5ddb7da902c2720Bob Halley <dfn>field</dfn> to be searched. This enables one to construct queries
0b72c791466d0807bcf22522b5ddb7da902c2720Bob Halley which search multiple <dfn>fields</dfn>.</li>
0b72c791466d0807bcf22522b5ddb7da902c2720Bob Halley</ul>
0b72c791466d0807bcf22522b5ddb7da902c2720Bob Halley<p>A clause may be either:</p>
0b72c791466d0807bcf22522b5ddb7da902c2720Bob Halley<ul>
0b72c791466d0807bcf22522b5ddb7da902c2720Bob Halley <li>a <dfn>term</dfn>, indicating all the documents that contain this term;
0b72c791466d0807bcf22522b5ddb7da902c2720Bob Halley or</li>
0b72c791466d0807bcf22522b5ddb7da902c2720Bob Halley <li>a <dfn>phrase</dfn> - group of words surrounded by double quotes
0b72c791466d0807bcf22522b5ddb7da902c2720Bob Halley <b>" "</b>, e.g. "hello dolly" </li>
0b72c791466d0807bcf22522b5ddb7da902c2720Bob Halley <li>a nested query, enclosed in parentheses "<b>(</b>" "<b>)</b>" (also
0b72c791466d0807bcf22522b5ddb7da902c2720Bob Halley called query/field <dfn>grouping</dfn>) . Note that this may be used
0b72c791466d0807bcf22522b5ddb7da902c2720Bob Halley with a +/- prefix to require any of a set of terms. </li>
0b72c791466d0807bcf22522b5ddb7da902c2720Bob Halley <li>boolean <dfn>operators</dfn> which allow terms to be combined through
0b72c791466d0807bcf22522b5ddb7da902c2720Bob Halley logic operators. Supported are <b>AND</b>(<b>&amp;&amp;</b>), "<b>+</b>",
0014d6342b0d50ae37126ac16d5bf821d02ffff7David Lawrence <b>OR</b>(<b>||</b>), <b>NOT</b>(<b>!</b>) and "<b>-</b>" (Note: they
0014d6342b0d50ae37126ac16d5bf821d02ffff7David Lawrence must be ALL CAPS).</li>
0014d6342b0d50ae37126ac16d5bf821d02ffff7David Lawrence</ul>
0014d6342b0d50ae37126ac16d5bf821d02ffff7David Lawrence<p>Regular Expression, Wildcard, Fuzzy, Proximity &amp; Range Searches:</p>
0014d6342b0d50ae37126ac16d5bf821d02ffff7David Lawrence<ul>
0014d6342b0d50ae37126ac16d5bf821d02ffff7David Lawrence <li>to perform a regular expression search use the "<b>/</b>" enclosure,
a9558a6c63d9c6dbb2f3800b39ccb008652fcde3Mark Andrews e.g. /[mb]an/ - will search for man or for ban;<br>
a9558a6c63d9c6dbb2f3800b39ccb008652fcde3Mark Andrews NOTE: path field search escapes "/" by default, so it only supports
a9558a6c63d9c6dbb2f3800b39ccb008652fcde3Mark Andrews regexps when the search string <u>starts and ends</u> with "/".<br>
c651f15b30f1dae5cc2f00878fb5da5b3a35a468Mark Andrews More info can be found on <a href="http://lucene.apache.org/core/4_5_0/core/org/apache/lucene/util/automaton/RegExp.html?is-external=true">lucene regexp page</a>.
c651f15b30f1dae5cc2f00878fb5da5b3a35a468Mark Andrews </li>
0014d6342b0d50ae37126ac16d5bf821d02ffff7David Lawrence <li>to perform a single character wildcard search use the "<b>?</b>" symbol,
0b72c791466d0807bcf22522b5ddb7da902c2720Bob Halley e.g. te?t</li>
0b72c791466d0807bcf22522b5ddb7da902c2720Bob Halley <li>to perform a multiple character wildcard search use the "<b>*</b>"
0b72c791466d0807bcf22522b5ddb7da902c2720Bob Halley symbol, e.g. test* or te*t</li>
0b72c791466d0807bcf22522b5ddb7da902c2720Bob Halley <li>you can use a * or ? symbol as the first character of a search
0b72c791466d0807bcf22522b5ddb7da902c2720Bob Halley (unless not enabled using indexer option -a).</li>
0b72c791466d0807bcf22522b5ddb7da902c2720Bob Halley <li>to do a fuzzy search (find words similar in spelling, based on the
0b72c791466d0807bcf22522b5ddb7da902c2720Bob Halley Levenshtein Distance, or Edit Distance algorithm) use the tilde,
0b72c791466d0807bcf22522b5ddb7da902c2720Bob Halley "<b>~</b>", e.g. rcs~ </li>
0b72c791466d0807bcf22522b5ddb7da902c2720Bob Halley <li>to do a proximity search use the tilde, "~", symbol at the end of a
0b72c791466d0807bcf22522b5ddb7da902c2720Bob Halley Phrase. For example to search for a "opengrok" and "help" within 10
0b72c791466d0807bcf22522b5ddb7da902c2720Bob Halley words of each other enter: "opengrok help"~10 </li>
0b72c791466d0807bcf22522b5ddb7da902c2720Bob Halley <li>range queries allow one to match documents whose field(s) values are
0b72c791466d0807bcf22522b5ddb7da902c2720Bob Halley between the lower and upper bound specified by the Range Query. Range
0b72c791466d0807bcf22522b5ddb7da902c2720Bob Halley Queries can be inclusive or exclusive of the upper and lower bounds.
0b72c791466d0807bcf22522b5ddb7da902c2720Bob Halley Sorting is done lexicographically. Inclusive queries are denoted by
0b72c791466d0807bcf22522b5ddb7da902c2720Bob Halley square brackets <b>[ ]</b> , exclusive by curly brackets <b>{ }</b>.
0b72c791466d0807bcf22522b5ddb7da902c2720Bob Halley For example: title:{Aida TO Carmen} - will find all documents between
0b72c791466d0807bcf22522b5ddb7da902c2720Bob Halley Aida to Carmen, exclusive of Aida and Carmen. </li>
0b72c791466d0807bcf22522b5ddb7da902c2720Bob Halley</ul>
0b72c791466d0807bcf22522b5ddb7da902c2720Bob Halley
0b72c791466d0807bcf22522b5ddb7da902c2720Bob Halley<a id="escaping"><dfn>Escaping special characters:</dfn></a>
0b72c791466d0807bcf22522b5ddb7da902c2720Bob Halley<p>Opengrok supports escaping special characters that are part of the query
0b72c791466d0807bcf22522b5ddb7da902c2720Bob Halley syntax. Current special characters are:<br/>
0b72c791466d0807bcf22522b5ddb7da902c2720Bob Halley <b>+ - &amp;&amp; || ! ( ) { } [ ] ^ " ~ * ? : \ / </b><br/>
0b72c791466d0807bcf22522b5ddb7da902c2720Bob HalleyTo escape these character use the \ before the character. For example to search
0b72c791466d0807bcf22522b5ddb7da902c2720Bob Halleyfor <b>(1+1):2</b> use the query: <b>\(1\+1\)\:2</b>
0b72c791466d0807bcf22522b5ddb7da902c2720Bob Halley</p>
0b72c791466d0807bcf22522b5ddb7da902c2720Bob Halley<p>NOTE on analyzers: Indexed words are made up of Alpha-Numeric and Underscore
0b72c791466d0807bcf22522b5ddb7da902c2720Bob Halleycharacters. One letter words are usually not indexed as symbols!<br/>
0b72c791466d0807bcf22522b5ddb7da902c2720Bob HalleyMost other characters (including single and double quotes) are treated as
0b72c791466d0807bcf22522b5ddb7da902c2720Bob Halley"spaces/whitespace" (so even if you escape them, they will not be found, since
0b72c791466d0807bcf22522b5ddb7da902c2720Bob Halleymost analyzers ignore them). <br/>
0b72c791466d0807bcf22522b5ddb7da902c2720Bob HalleyThe exceptions are: <b>@ $ % ^ &amp; = ? . :</b> which are mostly indexed as
0b72c791466d0807bcf22522b5ddb7da902c2720Bob Halleyseparate words.<br/>
0b72c791466d0807bcf22522b5ddb7da902c2720Bob HalleyBecause some of them are part of the query syntax, they must be escaped with a
0b72c791466d0807bcf22522b5ddb7da902c2720Bob Halleyreverse slash as noted above.<br/>
0b72c791466d0807bcf22522b5ddb7da902c2720Bob HalleySo searching for <b>\+1</b> or <b>\+ 1</b> will both find <b>+1</b> and <b>+ 1</b>.
0b72c791466d0807bcf22522b5ddb7da902c2720Bob Halley</p>
0b72c791466d0807bcf22522b5ddb7da902c2720Bob Halley
0b72c791466d0807bcf22522b5ddb7da902c2720Bob Halley<p>valid <dfn>FIELDs</dfn> are</p>
0b72c791466d0807bcf22522b5ddb7da902c2720Bob Halley <dl class="fields">
0b72c791466d0807bcf22522b5ddb7da902c2720Bob Halley<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! Please don't use "\", or replace it with "/".).</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_5_0/queryparser/org/apache/lucene/queryparser/classic/package-summary.html#package_description">lucene docs</a>.<br>
</p>
</div>
<%
}
/* ---------------------- help.jsp end --------------------- */
%><%@
include file="foot.jspf"
%>