help.jsp revision ba7acbadb299581bd4e995c01d86200e3c04a5c7
8886caf5dc3db70638022ddfd5442c0930bd43b5Mark Andrews<%--
8886caf5dc3db70638022ddfd5442c0930bd43b5Mark AndrewsCDDL HEADER START
8886caf5dc3db70638022ddfd5442c0930bd43b5Mark Andrews
8886caf5dc3db70638022ddfd5442c0930bd43b5Mark AndrewsThe contents of this file are subject to the terms of the
8886caf5dc3db70638022ddfd5442c0930bd43b5Mark AndrewsCommon Development and Distribution License (the "License").
8886caf5dc3db70638022ddfd5442c0930bd43b5Mark AndrewsYou may not use this file except in compliance with the License.
8886caf5dc3db70638022ddfd5442c0930bd43b5Mark Andrews
8886caf5dc3db70638022ddfd5442c0930bd43b5Mark AndrewsSee LICENSE.txt included in this distribution for the specific
8886caf5dc3db70638022ddfd5442c0930bd43b5Mark Andrewslanguage governing permissions and limitations under the License.
8886caf5dc3db70638022ddfd5442c0930bd43b5Mark Andrews
8886caf5dc3db70638022ddfd5442c0930bd43b5Mark AndrewsWhen distributing Covered Code, include this CDDL HEADER in each
8886caf5dc3db70638022ddfd5442c0930bd43b5Mark Andrewsfile and include the License file at LICENSE.txt.
8886caf5dc3db70638022ddfd5442c0930bd43b5Mark AndrewsIf applicable, add the following below this CDDL HEADER, with the
8886caf5dc3db70638022ddfd5442c0930bd43b5Mark Andrewsfields enclosed by brackets "[]" replaced with your own identifying
8886caf5dc3db70638022ddfd5442c0930bd43b5Mark Andrewsinformation: Portions Copyright [yyyy] [name of copyright owner]
8886caf5dc3db70638022ddfd5442c0930bd43b5Mark Andrews
8886caf5dc3db70638022ddfd5442c0930bd43b5Mark AndrewsCDDL HEADER END
8886caf5dc3db70638022ddfd5442c0930bd43b5Mark Andrews
8886caf5dc3db70638022ddfd5442c0930bd43b5Mark AndrewsCopyright (c) 2005, 2015, Oracle and/or its affiliates. All rights reserved.
8886caf5dc3db70638022ddfd5442c0930bd43b5Mark AndrewsUse is subject to license terms.
8886caf5dc3db70638022ddfd5442c0930bd43b5Mark Andrews
f41405d21249e11c1636301b1324ac1937b455aaMark AndrewsPortions Copyright 2011 Jens Elkner.
8886caf5dc3db70638022ddfd5442c0930bd43b5Mark Andrews
7e8f841d085cbd14b270f7bb9e2a2b7c5bc22565Mark Andrews--%><%@ page session="false" errorPage="error.jsp" import="
7e8f841d085cbd14b270f7bb9e2a2b7c5bc22565Mark Andrewsorg.opensolaris.opengrok.web.PageConfig,
8886caf5dc3db70638022ddfd5442c0930bd43b5Mark Andrewsorg.opensolaris.opengrok.search.SearchEngine"
8886caf5dc3db70638022ddfd5442c0930bd43b5Mark Andrews%><%
8886caf5dc3db70638022ddfd5442c0930bd43b5Mark Andrews/* ---------------------- help.jsp start --------------------- */
8886caf5dc3db70638022ddfd5442c0930bd43b5Mark Andrews{
8886caf5dc3db70638022ddfd5442c0930bd43b5Mark Andrews cfg = PageConfig.get(request);
8886caf5dc3db70638022ddfd5442c0930bd43b5Mark Andrews cfg.setTitle("OpenGrok Help");
7e8f841d085cbd14b270f7bb9e2a2b7c5bc22565Mark Andrews%><%@
8886caf5dc3db70638022ddfd5442c0930bd43b5Mark Andrews
8886caf5dc3db70638022ddfd5442c0930bd43b5Mark Andrewsinclude file="httpheader.jspf"
8886caf5dc3db70638022ddfd5442c0930bd43b5Mark Andrews
8886caf5dc3db70638022ddfd5442c0930bd43b5Mark Andrews%>
8886caf5dc3db70638022ddfd5442c0930bd43b5Mark Andrews<body>
33518843817dd9cf127eb09c5952227f1972af55Mark Andrews <div id="page">
8886caf5dc3db70638022ddfd5442c0930bd43b5Mark Andrews <div id="whole_header">
8886caf5dc3db70638022ddfd5442c0930bd43b5Mark Andrews <div id="header"><%@
8886caf5dc3db70638022ddfd5442c0930bd43b5Mark Andrews
7e8f841d085cbd14b270f7bb9e2a2b7c5bc22565Mark Andrewsinclude file="pageheader.jspf"
8886caf5dc3db70638022ddfd5442c0930bd43b5Mark Andrews
8886caf5dc3db70638022ddfd5442c0930bd43b5Mark Andrews %></div>
8886caf5dc3db70638022ddfd5442c0930bd43b5Mark Andrews <div id="Masthead"></div>
8886caf5dc3db70638022ddfd5442c0930bd43b5Mark Andrews </div>
8886caf5dc3db70638022ddfd5442c0930bd43b5Mark Andrews <div id="sbar">
8886caf5dc3db70638022ddfd5442c0930bd43b5Mark Andrews <div id="menu"><%@
8886caf5dc3db70638022ddfd5442c0930bd43b5Mark Andrews
8886caf5dc3db70638022ddfd5442c0930bd43b5Mark Andrewsinclude file="menu.jspf"
8886caf5dc3db70638022ddfd5442c0930bd43b5Mark Andrews
8886caf5dc3db70638022ddfd5442c0930bd43b5Mark Andrews%>
8886caf5dc3db70638022ddfd5442c0930bd43b5Mark Andrews </div>
8886caf5dc3db70638022ddfd5442c0930bd43b5Mark Andrews </div>
d39690e5a9b4a9a084d984abd193bed4395db41aDavid Lawrence <div id="help">
d39690e5a9b4a9a084d984abd193bed4395db41aDavid Lawrence
105f5a65b1f680f4cb6f897b8b0f7ee7e09e41ebDavid Lawrence<h4>Examples:</h4>
8886caf5dc3db70638022ddfd5442c0930bd43b5Mark Andrews<pre class="example">
8886caf5dc3db70638022ddfd5442c0930bd43b5Mark Andrews
88b3bc12b5570aae77e5963204e9111a2875915eAndreas GustafssonTo find where setResourceMonitors is defined:
8886caf5dc3db70638022ddfd5442c0930bd43b5Mark Andrews<a href="search?q=&amp;defs=setResourceMonitors">defs:setResourceMonitors</a>
8886caf5dc3db70638022ddfd5442c0930bd43b5Mark Andrews
8886caf5dc3db70638022ddfd5442c0930bd43b5Mark AndrewsTo find files that use sprintf in usr/src/cmd/cmd-inet/usr.sbin/:
ff8fd4d1b6abb0490b5aaf2b1d86555750ae0818Mark Andrews<a href="search?refs=sprintf&amp;path=usr%2Fsrc%2Fcmd%2Fcmd-inet%2Fusr.sbin%2F"
ff8fd4d1b6abb0490b5aaf2b1d86555750ae0818Mark Andrews>refs:sprintf path:usr/src/cmd/cmd-inet/usr.sbin</a>
ff8fd4d1b6abb0490b5aaf2b1d86555750ae0818Mark Andrews
9463feb3cb002df10b053f71e21540607c7a48e8Tatuya JINMEI 神明達哉To find assignments to variable foo:
c05a979fda35c83d7fba16fee7859644e98a7450Mark Andrews<a href="search?q=%22foo+%3D%22">"foo ="</a>
2a313f56e78e19ae6dc2315bb53bd32fad13ae29Mark Andrews
fcb54ce0a4f7377486df5bec83b3aa4711bf4131Mark AndrewsTo find Makefiles where pstack binary is being built:
58e0b35a3bbb50d154c36749096f7463dab75a7aMark Andrews<a href="search?q=pstack&amp;path=Makefile">pstack path:Makefile</a>
60c2c8814f838f503333da5b2fd7e6792ca39c14Mark Andrews
c58088e3a0fd9e553db750cd4b08d3e621d0ded4Mark Andrewsto search for phrase "Bill Joy":
b9858c2efcee324745a1b8d7b099baf540bc695bMark Andrews<a href="search?q=%22Bill+Joy%22">"Bill Joy"</a>
5a020bc04be73df06735da0ec1abb1dd71c755e5Mark Andrews
5a020bc04be73df06735da0ec1abb1dd71c755e5Mark AndrewsTo find perl files that do not use /usr/bin/perl but something else:
5a020bc04be73df06735da0ec1abb1dd71c755e5Mark Andrews<a href="search?q=-%22%2Fusr%2Fbin%2Fperl%22+%2B%22%2Fbin%2Fperl%22"
5a020bc04be73df06735da0ec1abb1dd71c755e5Mark Andrews>-"/usr/bin/perl" +"/bin/perl"</a>
58e0b35a3bbb50d154c36749096f7463dab75a7aMark Andrews
a69a77ddfef58e93036cf6173dc7f91ed864d103Mark AndrewsTo find all strings beginning with foo use the wildcard:
f4545143206d918a7f6ee53cd4fb9788c534c0c7Mark Andrews<a href="search?q=foo*">foo*</a>
09233633dadbd7878e60dd383a814e24e5eda1c6Mark Andrews
09233633dadbd7878e60dd383a814e24e5eda1c6Mark AndrewsTo find all files which have . c in their name (dot is a token!):
09233633dadbd7878e60dd383a814e24e5eda1c6Mark Andrews<a href="search?path=%22. c%22">". c"</a>
ea37c1a7780311cc7076ff54f09774b2296aebe5Mark Andrews
de90c0b2efac159580365beaa761a14bdb74330cMark AndrewsTo find all files which start with "ma" and then have only alphabet characters do:
49aa1303a7cf1ec2a06cde11e46a039dddfca8feMark Andrews<a href="search?path=/ma[a-zA-Z]*/">path:/ma[a-zA-Z]*/</a>
e20eae14fc554bae394f535067e80884b59d0684Mark Andrews
e03d4ecce3b62bb0a02d2f5e2cc1a9549df08498Mark AndrewsTo find all main methods in all files analyzed by C analyzer (so .c, .h, ...) do:
e03d4ecce3b62bb0a02d2f5e2cc1a9549df08498Mark Andrews<a href="search?q=main&type=c">main type:c</a>
1c8c1aa1c6a103a6495109069cca518c9f475f39Mark Andrews</pre>
d4ae7d9200ebad7700e8e85886cabe93ab24afd8Mark Andrews
b6f837397dadf6b296ee1825c95e90235ee5b5ffMark Andrews<h4>More info:</h4>
b6f837397dadf6b296ee1825c95e90235ee5b5ffMark AndrewsA <dfn>Query</dfn> is a series of clauses. A clause may be prefixed by:
d4cefad19e32879e6847df043e62ad8f9cbfa06bMark Andrews<ul>
2984f8f7bf213642e47affe710851ff0d6580083Mark Andrews <li>a plus "<b>+</b>" or a minus "<b>-</b>" sign, indicating that the clause
666bae3ccc9d50d840dd6b7b13731f7653f74e77Mark Andrews is required or prohibited respectively; or</li>
a14a8a963a407d636f76e223704f62440bd10176Mark Andrews <li>a <dfn>term</dfn> followed by a colon "<b>:</b>", indicating the
fd6574dbc551faac89ae2ce6f3549fed51c24e49Mark Andrews <dfn>field</dfn> to be searched. This enables one to construct queries
fd6574dbc551faac89ae2ce6f3549fed51c24e49Mark Andrews which search multiple <dfn>fields</dfn>.</li>
fd6574dbc551faac89ae2ce6f3549fed51c24e49Mark Andrews</ul>
cb6fe566ff051ade7b99f5ca9fca897193d1bd4fMark Andrews<p>A <dfn>clause</dfn> may be either:</p>
d3e93aac7a6a647b1a2905bfdbdd5ce1b9e46a73Mark Andrews<ul>
<li>a <dfn>term</dfn>, indicating all the documents that contain this term;
or</li>
<li>a <dfn>phrase</dfn> - group of words surrounded by double quotes
<b>" "</b>, e.g. "hello dolly" </li>
<li>a nested query, enclosed in parentheses "<b>(</b>" "<b>)</b>" (also
called query/field <dfn>grouping</dfn>) . Note that this may be used
with a +/- prefix to require any of a set of terms. </li>
<li>boolean <dfn>operators</dfn> which allow terms to be combined through
logic operators. Supported are <b>AND</b>(<b>&amp;&amp;</b>), "<b>+</b>",
<b>OR</b>(<b>||</b>), <b>NOT</b>(<b>!</b>) and "<b>-</b>" (Note: they
must be ALL CAPS).</li>
</ul>
<p>Regular Expression, Wildcard, Fuzzy, Proximity &amp; Range Searches:</p>
<ul>
<li>to perform a regular expression search use the "<b>/</b>" enclosure,
e.g. /[mb]an/ - will search for man or for ban;<br/>
NOTE: path field search escapes "/" by default, so it only supports
regexps when the search string <u>starts and ends</u> with "/".<br/>
More info can be found on <a href="http://lucene.apache.org/core/<%=SearchEngine.LUCENE_VERSION_HELP%>/core/org/apache/lucene/util/automaton/RegExp.html?is-external=true">Lucene regexp page</a>.
</li>
<li>to perform a single character wildcard search use the "<b>?</b>" symbol,
e.g. te?t</li>
<li>to perform a multiple character wildcard search use the "<b>*</b>"
symbol, e.g. test* or te*t</li>
<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.getFileTypeDescriptions().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/<%=SearchEngine.LUCENE_VERSION_HELP%>/queryparser/org/apache/lucene/queryparser/classic/package-summary.html#package_description">Lucene docs</a>.
</p>
<h4>Intelligence Window</h4>
<p>
Key "1" toggles <dfn>Intelligence Window</dfn>. It gives the user many helper actions on the last symbol pointed by the mouse cursor.
</p>
<img src="default/img/intelli-window.png"/>
<h4>Symbol Highlighting</h4>
<p>
Key "2" toggles highlighting of the last symbol pointed by the mouse cursor. This functionality is also accessible via the <dfn>Intelligence Window</dfn>.
</p>
<img src="default/img/symbol-highlighting.png"/>
</div>
<%
}
/* ---------------------- help.jsp end --------------------- */
%><%@
include file="foot.jspf"
%>