xref: /OpenGrok/opengrok-web/src/main/webapp/help.jsp (revision 686556f26bc99756591ef65c73f3dc438ca40b46)
10d40e9d0SAdam Hornáček<%--
20d40e9d0SAdam HornáčekCDDL HEADER START
30d40e9d0SAdam Hornáček
40d40e9d0SAdam HornáčekThe contents of this file are subject to the terms of the
50d40e9d0SAdam HornáčekCommon Development and Distribution License (the "License").
60d40e9d0SAdam HornáčekYou may not use this file except in compliance with the License.
70d40e9d0SAdam Hornáček
80d40e9d0SAdam HornáčekSee LICENSE.txt included in this distribution for the specific
90d40e9d0SAdam Hornáčeklanguage governing permissions and limitations under the License.
100d40e9d0SAdam Hornáček
110d40e9d0SAdam HornáčekWhen distributing Covered Code, include this CDDL HEADER in each
120d40e9d0SAdam Hornáčekfile and include the License file at LICENSE.txt.
130d40e9d0SAdam HornáčekIf applicable, add the following below this CDDL HEADER, with the
140d40e9d0SAdam Hornáčekfields enclosed by brackets "[]" replaced with your own identifying
150d40e9d0SAdam Hornáčekinformation: Portions Copyright [yyyy] [name of copyright owner]
160d40e9d0SAdam Hornáček
170d40e9d0SAdam HornáčekCDDL HEADER END
180d40e9d0SAdam Hornáček
1956f072caSAdam HornáčekCopyright (c) 2005, 2018, Oracle and/or its affiliates. All rights reserved.
200d40e9d0SAdam HornáčekPortions Copyright 2011 Jens Elkner.
21a804b2d7SAdam HornáčekPortions Copyright (c) 2018, Chris Fraire <cfraire@me.com>.
220d40e9d0SAdam Hornáček
23a804b2d7SAdam Hornáček--%>
24a804b2d7SAdam Hornáček<%@page contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
25a804b2d7SAdam Hornáček<%@page session="false" errorPage="error.jsp" import="
26*686556f2SAdam Hornáčekorg.opengrok.indexer.web.PageConfig,
27*686556f2SAdam Hornáčekorg.opengrok.indexer.search.SearchEngine"
280d40e9d0SAdam Hornáček%><%
290d40e9d0SAdam Hornáček/* ---------------------- help.jsp start --------------------- */
300d40e9d0SAdam Hornáček{
310d40e9d0SAdam Hornáček    PageConfig cfg = PageConfig.get(request);
320d40e9d0SAdam Hornáček    cfg.checkSourceRootExistence();
330d40e9d0SAdam Hornáček    cfg.setTitle("OpenGrok Help");
340d40e9d0SAdam Hornáček}
350d40e9d0SAdam Hornáček%><%@
360d40e9d0SAdam Hornáček
370d40e9d0SAdam Hornáčekinclude file="httpheader.jspf"
380d40e9d0SAdam Hornáček
390d40e9d0SAdam Hornáček%>
400d40e9d0SAdam Hornáček<body>
410d40e9d0SAdam Hornáček    <div id="page">
420d40e9d0SAdam Hornáček        <div id="whole_header">
430d40e9d0SAdam Hornáček            <div id="header"><%@
440d40e9d0SAdam Hornáček
450d40e9d0SAdam Hornáčekinclude file="pageheader.jspf"
460d40e9d0SAdam Hornáček
470d40e9d0SAdam Hornáček            %></div>
480d40e9d0SAdam Hornáček            <div id="Masthead">Help page</div>
490d40e9d0SAdam Hornáček        </div>
500d40e9d0SAdam Hornáček        <div id="sbar">
510d40e9d0SAdam Hornáček            <div id="menu"><%@
520d40e9d0SAdam Hornáček
530d40e9d0SAdam Hornáčekinclude file="menu.jspf"
540d40e9d0SAdam Hornáček
550d40e9d0SAdam Hornáček%>
560d40e9d0SAdam Hornáček            </div>
570d40e9d0SAdam Hornáček        </div>
580d40e9d0SAdam Hornáček        <div id="help">
590d40e9d0SAdam Hornáček
600d40e9d0SAdam Hornáček<h4>Examples:</h4>
610d40e9d0SAdam Hornáček<pre class="example">
620d40e9d0SAdam Hornáček
630d40e9d0SAdam HornáčekTo find where setResourceMonitors is defined:
640d40e9d0SAdam Hornáček<a href="search?q=&amp;defs=setResourceMonitors">defs:setResourceMonitors</a>
650d40e9d0SAdam Hornáček
660d40e9d0SAdam HornáčekTo find files that use sprintf in usr/src/cmd/cmd-inet/usr.sbin/:
670d40e9d0SAdam Hornáček<a href="search?refs=sprintf&amp;path=usr%2Fsrc%2Fcmd%2Fcmd-inet%2Fusr.sbin%2F"
680d40e9d0SAdam Hornáček>refs:sprintf path:usr/src/cmd/cmd-inet/usr.sbin</a>
690d40e9d0SAdam Hornáček
700d40e9d0SAdam HornáčekTo find assignments to variable foo:
710d40e9d0SAdam Hornáček<a href="search?q=%22foo+%3D%22">"foo ="</a>
720d40e9d0SAdam Hornáček
730d40e9d0SAdam HornáčekTo find Makefiles where pstack binary is being built:
740d40e9d0SAdam Hornáček<a href="search?q=pstack&amp;path=Makefile">pstack path:Makefile</a>
750d40e9d0SAdam Hornáček
760d40e9d0SAdam Hornáčekto search for phrase "Bill Joy":
770d40e9d0SAdam Hornáček<a href="search?q=%22Bill+Joy%22">"Bill Joy"</a>
780d40e9d0SAdam Hornáček
790d40e9d0SAdam HornáčekTo find perl files that do not use /usr/bin/perl but something else:
800d40e9d0SAdam Hornáček<a href="search?q=-%22%2Fusr%2Fbin%2Fperl%22+%2B%22%2Fbin%2Fperl%22"
810d40e9d0SAdam Hornáček>-"/usr/bin/perl" +"/bin/perl"</a>
820d40e9d0SAdam Hornáček
830d40e9d0SAdam HornáčekTo find all strings beginning with foo use the wildcard:
840d40e9d0SAdam Hornáček<a href="search?q=foo*">foo*</a>
850d40e9d0SAdam Hornáček
860d40e9d0SAdam HornáčekTo find all files which have . c in their name (dot is a token!):
870d40e9d0SAdam Hornáček<a href="search?path=%22. c%22">". c"</a>
880d40e9d0SAdam Hornáček
890d40e9d0SAdam HornáčekTo find all files which start with "ma" and then have only alphabet characters do:
900d40e9d0SAdam Hornáček<a href="search?path=/ma[a-zA-Z]*/">path:/ma[a-zA-Z]*/</a>
910d40e9d0SAdam Hornáček
920d40e9d0SAdam HornáčekTo find all main methods in all files analyzed by C analyzer (so .c, .h, ...) do:
930d40e9d0SAdam Hornáček<a href="search?q=main&type=c">main type:c</a>
940d40e9d0SAdam Hornáček</pre>
950d40e9d0SAdam Hornáček
960d40e9d0SAdam Hornáček<h4>More info:</h4>
970d40e9d0SAdam HornáčekA <dfn>Query</dfn> is a series of clauses. A clause may be prefixed by:
980d40e9d0SAdam Hornáček<ul>
990d40e9d0SAdam Hornáček    <li>a plus "<b>+</b>" or a minus "<b>-</b>" sign, indicating that the clause
1000d40e9d0SAdam Hornáček        is required or prohibited respectively; or</li>
1010d40e9d0SAdam Hornáček    <li>a <dfn>term</dfn> followed by a colon "<b>:</b>", indicating the
1020d40e9d0SAdam Hornáček        <dfn>field</dfn> to be searched. This enables one to construct queries
1030d40e9d0SAdam Hornáček        which search multiple <dfn>fields</dfn>.</li>
1040d40e9d0SAdam Hornáček</ul>
1050d40e9d0SAdam Hornáček<p>A <dfn>clause</dfn> may be either:</p>
1060d40e9d0SAdam Hornáček<ul>
1070d40e9d0SAdam Hornáček    <li>a <dfn>term</dfn>, indicating all the documents that contain this term;
1080d40e9d0SAdam Hornáček        or</li>
1090d40e9d0SAdam Hornáček    <li>a <dfn>phrase</dfn> - group of words surrounded by double quotes
1100d40e9d0SAdam Hornáček        <b>" "</b>, e.g. "hello dolly"  </li>
1110d40e9d0SAdam Hornáček    <li>a nested query, enclosed in parentheses "<b>(</b>" "<b>)</b>" (also
1120d40e9d0SAdam Hornáček        called query/field <dfn>grouping</dfn>) . Note that this may be used
1130d40e9d0SAdam Hornáček        with a +/- prefix to require any of a set of terms. </li>
1140d40e9d0SAdam Hornáček    <li>boolean <dfn>operators</dfn> which allow terms to be combined through
1150d40e9d0SAdam Hornáček        logic operators. Supported are <b>AND</b>(<b>&amp;&amp;</b>), "<b>+</b>",
1160d40e9d0SAdam Hornáček        <b>OR</b>(<b>||</b>), <b>NOT</b>(<b>!</b>) and "<b>-</b>" (Note: they
1170d40e9d0SAdam Hornáček        must be ALL CAPS).</li>
1180d40e9d0SAdam Hornáček</ul>
1190d40e9d0SAdam Hornáček<p>Regular Expression, Wildcard, Fuzzy, Proximity &amp; Range Searches:</p>
1200d40e9d0SAdam Hornáček<ul>
1210d40e9d0SAdam Hornáček    <li>to perform a regular expression search use the "<b>/</b>" enclosure,
1220d40e9d0SAdam Hornáček        e.g.  /[mb]an/ - will search for man or for ban;<br/>
1230d40e9d0SAdam Hornáček        NOTE: path field search escapes "/" by default, so it only supports
1240d40e9d0SAdam Hornáček        regexps when the search string <u>starts and ends</u> with "/".<br/>
1250d40e9d0SAdam Hornáček        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>.
1260d40e9d0SAdam Hornáček    </li>
1270d40e9d0SAdam Hornáček    <li>to perform a single character wildcard search use the "<b>?</b>" symbol,
1280d40e9d0SAdam Hornáček        e.g.  te?t</li>
1290d40e9d0SAdam Hornáček    <li>to perform a multiple character wildcard search use the "<b>*</b>"
1300d40e9d0SAdam Hornáček        symbol, e.g. test* or te*t</li>
1310d40e9d0SAdam Hornáček    <li>you can use a * or ? symbol as the first character of a search
1320d40e9d0SAdam Hornáček        (unless not enabled using indexer option -a).</li>
1330d40e9d0SAdam Hornáček    <li>to do a fuzzy search (find words similar in spelling, based on the
1340d40e9d0SAdam Hornáček        Levenshtein Distance, or Edit Distance algorithm) use the tilde,
1350d40e9d0SAdam Hornáček        "<b>~</b>", e.g. rcs~ </li>
1360d40e9d0SAdam Hornáček    <li>to do a proximity search use the tilde, "~", symbol at the end of a
1370d40e9d0SAdam Hornáček        Phrase. For example to search for a "opengrok" and "help" within 10
1380d40e9d0SAdam Hornáček        words of each other enter: "opengrok help"~10 </li>
1390d40e9d0SAdam Hornáček    <li>range queries allow one to match documents whose field(s) values are
1400d40e9d0SAdam Hornáček        between the lower and upper bound specified by the Range Query. Range
1410d40e9d0SAdam Hornáček        Queries can be inclusive or exclusive of the upper and lower bounds.
1420d40e9d0SAdam Hornáček        Sorting is done lexicographically. Inclusive queries are denoted by
1430d40e9d0SAdam Hornáček        square brackets <b>[ ]</b> , exclusive by curly brackets <b>{ }</b>.
1440d40e9d0SAdam Hornáček        For example: title:{Aida TO Carmen} - will find all documents between
1450d40e9d0SAdam Hornáček        Aida to Carmen, exclusive of Aida and Carmen. </li>
1460d40e9d0SAdam Hornáček</ul>
1470d40e9d0SAdam Hornáček
1480d40e9d0SAdam Hornáček<a id="escaping"><dfn>Escaping special characters:</dfn></a>
1490d40e9d0SAdam Hornáček<p>
1500d40e9d0SAdam Hornáček    Opengrok supports escaping special characters that are part of the query
1510d40e9d0SAdam Hornáček    syntax. Current special characters are:<br/>
1520d40e9d0SAdam Hornáček    <b>+ - &amp;&amp; || ! ( ) { } [ ] ^ " ~ * ? : \ / </b><br/>
1530d40e9d0SAdam Hornáček    To escape these character use the \ before the character. For example to
1540d40e9d0SAdam Hornáček    search for <b>(1+1):2</b> use the query: <b>\(1\+1\)\:2</b>
1550d40e9d0SAdam Hornáček</p>
1560d40e9d0SAdam Hornáček<p>
1570d40e9d0SAdam Hornáček    NOTE on analyzers: Indexed words are made up of Alpha-Numeric and Underscore
1580d40e9d0SAdam Hornáček    characters. One letter words are usually not indexed as symbols!<br/>
1590d40e9d0SAdam Hornáček    Most other characters (including single and double quotes) are treated as
1600d40e9d0SAdam Hornáček    "spaces/whitespace" (so even if you escape them, they will not be found, since
1610d40e9d0SAdam Hornáček    most analyzers ignore them). <br/>
1620d40e9d0SAdam Hornáček    The exceptions are: <b>@ $ % ^ &amp; = ? . :</b> which are mostly indexed as
1630d40e9d0SAdam Hornáček    separate words.<br/>
1640d40e9d0SAdam Hornáček    Because some of them are part of the query syntax, they must be escaped with a
1650d40e9d0SAdam Hornáček    reverse slash as noted above.<br/>
1660d40e9d0SAdam Hornáček    So searching for <b>\+1</b> or <b>\+ 1</b> will both find <b>+1</b> and <b>+ 1</b>.
1670d40e9d0SAdam Hornáček</p>
1680d40e9d0SAdam Hornáček
1690d40e9d0SAdam Hornáček<p>Valid <dfn>FIELDs</dfn> are</p>
1700d40e9d0SAdam Hornáček<dl class="fields">
1710d40e9d0SAdam Hornáček    <dt>full</dt>
1720d40e9d0SAdam Hornáček    <dd>Search through all text tokens (words,strings,identifiers,numbers) in index.</dd>
1730d40e9d0SAdam Hornáček
1740d40e9d0SAdam Hornáček    <dt>defs</dt>
1750d40e9d0SAdam Hornáček    <dd>Only finds symbol definitions (where e.g. a variable (function, ...) is defined).</dd>
1760d40e9d0SAdam Hornáček
1770d40e9d0SAdam Hornáček    <dt>refs</dt>
1780d40e9d0SAdam Hornáček    <dd>Only finds symbols (e.g. methods, classes, functions, variables).</dd>
1790d40e9d0SAdam Hornáček
1800d40e9d0SAdam Hornáček    <dt>path</dt>
1810d40e9d0SAdam Hornáček    <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>
1820d40e9d0SAdam Hornáček
1830d40e9d0SAdam Hornáček    <%
1840d40e9d0SAdam Hornáček        if (PageConfig.get(request).getEnv().isHistoryEnabled()) {
1850d40e9d0SAdam Hornáček    %>
1860d40e9d0SAdam Hornáček    <dt>hist</dt>
1870d40e9d0SAdam Hornáček    <dd>History log comments.</dd>
1880d40e9d0SAdam Hornáček    <%
1890d40e9d0SAdam Hornáček        }
1900d40e9d0SAdam Hornáček    %>
1910d40e9d0SAdam Hornáček
1920d40e9d0SAdam Hornáček    <dt>type</dt>
1930d40e9d0SAdam Hornáček    <dd>Type of analyzer used to scope down to certain file types (e.g. just C sources).<br/>Current mappings: <%=SearchHelper.getFileTypeDescriptions().toString()%></dd>
1940d40e9d0SAdam Hornáček</dl>
1950d40e9d0SAdam Hornáček
1960d40e9d0SAdam Hornáček<p>
1970d40e9d0SAdam Hornáček    The term (phrases) can be boosted (making it more relevant) using a caret
1980d40e9d0SAdam Hornáček    <b>^</b> , e.g. help^4 opengrok - will make term help boosted
1990d40e9d0SAdam Hornáček</p>
2000d40e9d0SAdam Hornáček
2010d40e9d0SAdam Hornáček<p>Opengrok search is powered by <a href="http://lucene.apache.org/">Lucene</a>,
2020d40e9d0SAdam Hornáčekfor 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>.
2030d40e9d0SAdam Hornáček</p>
2040d40e9d0SAdam Hornáček
2050d40e9d0SAdam Hornáček<h4>Intelligence Window</h4>
2060d40e9d0SAdam Hornáček<p>
2070d40e9d0SAdam HornáčekKey "1" toggles <dfn>Intelligence Window</dfn>.  It gives the user many helper actions on the last symbol pointed by the mouse cursor.
2080d40e9d0SAdam Hornáček</p>
2090d40e9d0SAdam Hornáček<img src="<%= PageConfig.get(request).getCssDir() %>/img/intelli-window.png"/>
2100d40e9d0SAdam Hornáček
2110d40e9d0SAdam Hornáček<h5>Symbol Highlighting</h5>
2120d40e9d0SAdam Hornáček<p>
2130d40e9d0SAdam HornáčekKeys "2", "3", "4" toggles highlighting of the last symbol pointed by the mouse cursor.  This functionality is also accessible via the <dfn>Intelligence Window</dfn>.
2140d40e9d0SAdam Hornáček</p>
2150d40e9d0SAdam Hornáček<p>
2160d40e9d0SAdam HornáčekKey "5" toggles unhighlighting all symbols. This functionality is also accessible via the <dfn>Intelligence Window</dfn>.
2170d40e9d0SAdam Hornáček</p>
2180d40e9d0SAdam Hornáček<img src="<%= PageConfig.get(request).getCssDir() %>/img/symbol-highlighting.png"/>
2190d40e9d0SAdam Hornáček
2200d40e9d0SAdam Hornáček<p>
2210d40e9d0SAdam Hornáček    You can close the intelligence window either by mouse in the right upper corner or by keyboard with "Esc" key.
2220d40e9d0SAdam Hornáček</p>
2230d40e9d0SAdam Hornáček
2240d40e9d0SAdam Hornáček<h5>Symbol jumping</h5>
2250d40e9d0SAdam Hornáček<p>
2260d40e9d0SAdam HornáčekBy 'n' for next and 'b' for back you can jump between the symbols easily only with keyboard. When there is no symbol highlighted then the jump
2270d40e9d0SAdam Hornáčekis made to the next symbol in the file from the current one. If you have highlighted a specific symbol then the jump is done only among the highlighted symbols regardless the color of the symbol.
2280d40e9d0SAdam Hornáček</p>
2290d40e9d0SAdam Hornáček
2300d40e9d0SAdam Hornáček<h4>Diff jumper</h4>
2310d40e9d0SAdam Hornáček
2320d40e9d0SAdam Hornáček<p>
2330d40e9d0SAdam HornáčekThe OpenGrok also provides an easy way how to jump through the large diffs finding the interesting pieces of code. In the diff mode you can enable diff jumper by hitting the "jumper" button.
2340d40e9d0SAdam Hornáček</p>
2350d40e9d0SAdam Hornáček<img src="<%= PageConfig.get(request).getCssDir() %>/img/diff-jumper.png"/>
2360d40e9d0SAdam Hornáček
2370d40e9d0SAdam Hornáček<h5>Mouse and keyboard navigation</h5>
2380d40e9d0SAdam Hornáček<p>
2390d40e9d0SAdam HornáčekYou can then use your mouse to intuitively navigate yourself through the diff. Also there is a convenient shortcut for moving on your keyboard,
2400d40e9d0SAdam Hornáčekyou can use 'n' for next and 'b' for back to jump over to the next chunk. This is available even when the jumper window is not opened.
2410d40e9d0SAdam Hornáček</p>
2420d40e9d0SAdam Hornáček<img src="<%= PageConfig.get(request).getCssDir() %>/img/diff-jumping.png"/>
2430d40e9d0SAdam Hornáček
2440d40e9d0SAdam Hornáček        </div>
2450d40e9d0SAdam Hornáček<%
2460d40e9d0SAdam Hornáček/* ---------------------- help.jsp end --------------------- */
2470d40e9d0SAdam Hornáček%><%@
2480d40e9d0SAdam Hornáček
2490d40e9d0SAdam Hornáčekinclude file="foot.jspf"
2500d40e9d0SAdam Hornáček
2510d40e9d0SAdam Hornáček%>
252