xref: /OpenGrok/opengrok-web/src/main/webapp/help.jsp (revision 60ad31659dbf7459e1eea54fe5903b91085a16ea)
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
19aa18fa28SAdam HornacekCopyright (c) 2005, 2021, Oracle and/or its affiliates. All rights reserved.
200d40e9d0SAdam HornáčekPortions Copyright 2011 Jens Elkner.
211c830032SChris FrairePortions Copyright (c) 2018, 2020, Chris Fraire <cfraire@me.com>.
22*60ad3165SKryštof TulingerPortions Copyright (c) 2022, Krystof Tulinger <k.tulinger@seznam.cz>.
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="
261c830032SChris Fraireorg.opengrok.indexer.search.SearchEngine,
27d8a7afe2SAdam Hornacekorg.opengrok.web.PageConfig,
281c830032SChris Fraireorg.opengrok.indexer.web.QueryParameters"
291c830032SChris Fraire%>
301c830032SChris Fraire<%
310d40e9d0SAdam Hornáček/* ---------------------- help.jsp start --------------------- */
320d40e9d0SAdam Hornáček{
330d40e9d0SAdam Hornáček    PageConfig cfg = PageConfig.get(request);
340d40e9d0SAdam Hornáček    cfg.checkSourceRootExistence();
350d40e9d0SAdam Hornáček    cfg.setTitle("OpenGrok Help");
360d40e9d0SAdam Hornáček}
370d40e9d0SAdam Hornáček%><%@
380d40e9d0SAdam Hornáček
390d40e9d0SAdam Hornáčekinclude file="httpheader.jspf"
400d40e9d0SAdam Hornáček
410d40e9d0SAdam Hornáček%>
420d40e9d0SAdam Hornáček<body>
430d40e9d0SAdam Hornáček    <div id="page">
44aa18fa28SAdam Hornacek        <header id="whole_header">
45aa18fa28SAdam Hornacek            <%@include file="pageheader.jspf" %>
460d40e9d0SAdam Hornáček            <div id="Masthead">Help page</div>
47aa18fa28SAdam Hornacek        </header>
480d40e9d0SAdam Hornáček        <div id="sbar">
490d40e9d0SAdam Hornáček            <div id="menu"><%@
500d40e9d0SAdam Hornáček
510d40e9d0SAdam Hornáčekinclude file="menu.jspf"
520d40e9d0SAdam Hornáček
530d40e9d0SAdam Hornáček%>
540d40e9d0SAdam Hornáček            </div>
550d40e9d0SAdam Hornáček        </div>
560d40e9d0SAdam Hornáček        <div id="help">
570d40e9d0SAdam Hornáček
580d40e9d0SAdam Hornáček<h4>Examples:</h4>
590d40e9d0SAdam Hornáček<pre class="example">
600d40e9d0SAdam Hornáček
610d40e9d0SAdam HornáčekTo find where setResourceMonitors is defined:
621c830032SChris Fraire<a href="search?<%= QueryParameters.FULL_SEARCH_PARAM_EQ %>&amp;
631c830032SChris Fraire<%= QueryParameters.DEFS_SEARCH_PARAM_EQ %>setResourceMonitors">
641c830032SChris Fraire    <%= QueryBuilder.DEFS %>:setResourceMonitors</a>
650d40e9d0SAdam Hornáček
660d40e9d0SAdam HornáčekTo find files that use sprintf in usr/src/cmd/cmd-inet/usr.sbin/:
671c830032SChris Fraire<a href="search?<%= QueryParameters.REFS_SEARCH_PARAM_EQ %>sprintf&amp;
681c830032SChris Fraire<%= QueryParameters.PATH_SEARCH_PARAM_EQ %>usr%2Fsrc%2Fcmd%2Fcmd-inet%2Fusr.sbin%2F"
691c830032SChris Fraire><%= QueryBuilder.REFS %>:sprintf <%= QueryBuilder.PATH %>:usr/src/cmd/cmd-inet/usr.sbin</a>
700d40e9d0SAdam Hornáček
710d40e9d0SAdam HornáčekTo find assignments to variable foo:
721c830032SChris Fraire<a href="search?<%= QueryParameters.FULL_SEARCH_PARAM_EQ %>%22foo+%3D%22">"foo ="</a>
730d40e9d0SAdam Hornáček
740d25be72SVladimir Kotal    To find Makefiles where the <code>pstack</code> binary is being built:
751c830032SChris Fraire<a href="search?<%= QueryParameters.FULL_SEARCH_PARAM_EQ %>pstack&amp;
761c830032SChris Fraire<%= QueryParameters.PATH_SEARCH_PARAM_EQ %>Makefile">pstack <%= QueryBuilder.PATH %>:Makefile</a>
770d40e9d0SAdam Hornáček
780d40e9d0SAdam Hornáčekto search for phrase "Bill Joy":
791c830032SChris Fraire<a href="search?<%= QueryParameters.FULL_SEARCH_PARAM_EQ %>%22Bill+Joy%22">"Bill Joy"</a>
800d40e9d0SAdam Hornáček
810d40e9d0SAdam HornáčekTo find perl files that do not use /usr/bin/perl but something else:
821c830032SChris Fraire<a href="search?<%= QueryParameters.FULL_SEARCH_PARAM_EQ %>-%22%2Fusr%2Fbin%2Fperl%22+%2B%22%2Fbin%2Fperl%22"
830d40e9d0SAdam Hornáček>-"/usr/bin/perl" +"/bin/perl"</a>
840d40e9d0SAdam Hornáček
850d40e9d0SAdam HornáčekTo find all strings beginning with foo use the wildcard:
861c830032SChris Fraire<a href="search?<%= QueryParameters.FULL_SEARCH_PARAM_EQ %>foo*">foo*</a>
870d40e9d0SAdam Hornáček
880d40e9d0SAdam HornáčekTo find all files which have . c in their name (dot is a token!):
891c830032SChris Fraire<a href="search?<%= QueryParameters.PATH_SEARCH_PARAM_EQ %>%22. c%22">". c"</a>
900d40e9d0SAdam Hornáček
910d40e9d0SAdam HornáčekTo find all files which start with "ma" and then have only alphabet characters do:
921c830032SChris Fraire<a href="search?<%= QueryParameters.PATH_SEARCH_PARAM_EQ %>/ma[a-zA-Z]*/">
931c830032SChris Fraire    <%= QueryBuilder.PATH %>:/ma[a-zA-Z]*/</a>
940d40e9d0SAdam Hornáček
950d40e9d0SAdam HornáčekTo find all main methods in all files analyzed by C analyzer (so .c, .h, ...) do:
961c830032SChris Fraire<a href="search?<%= QueryParameters.FULL_SEARCH_PARAM_EQ %>main&amp;
971c830032SChris Fraire<%= QueryParameters.TYPE_SEARCH_PARAM_EQ %>c">main <%= QueryBuilder.TYPE %>:c</a>
980d40e9d0SAdam Hornáček</pre>
990d40e9d0SAdam Hornáček
1000d40e9d0SAdam Hornáček<h4>More info:</h4>
1010d40e9d0SAdam HornáčekA <dfn>Query</dfn> is a series of clauses. A clause may be prefixed by:
1020d40e9d0SAdam Hornáček<ul>
1030d25be72SVladimir Kotal    <li>a plus "<code>+</code>" or a minus "<code>-</code>" sign, indicating that the clause
1040d40e9d0SAdam Hornáček        is required or prohibited respectively; or</li>
1050d25be72SVladimir Kotal    <li>a <dfn>term</dfn> followed by a colon "<code>:</code>", indicating the
1060d40e9d0SAdam Hornáček        <dfn>field</dfn> to be searched. This enables one to construct queries
1070d40e9d0SAdam Hornáček        which search multiple <dfn>fields</dfn>.</li>
1080d40e9d0SAdam Hornáček</ul>
1090d40e9d0SAdam Hornáček<p>A <dfn>clause</dfn> may be either:</p>
1100d40e9d0SAdam Hornáček<ul>
1110d40e9d0SAdam Hornáček    <li>a <dfn>term</dfn>, indicating all the documents that contain this term;
1120d40e9d0SAdam Hornáček        or</li>
1130d40e9d0SAdam Hornáček    <li>a <dfn>phrase</dfn> - group of words surrounded by double quotes
1140d25be72SVladimir Kotal        <code>" "</code>, e.g. "hello dolly"  </li>
1150d25be72SVladimir Kotal    <li>a nested query, enclosed in parentheses "<code>(</code>" "<code>)</code>" (also
1160d40e9d0SAdam Hornáček        called query/field <dfn>grouping</dfn>) . Note that this may be used
1170d40e9d0SAdam Hornáček        with a +/- prefix to require any of a set of terms. </li>
1180d40e9d0SAdam Hornáček    <li>boolean <dfn>operators</dfn> which allow terms to be combined through
1190d25be72SVladimir Kotal        logic operators. Supported are <code>AND</code>(<code>&amp;&amp;</code>), "<code>+</code>",
1200d25be72SVladimir Kotal        <code>OR</code>(<code>||</code>), <code>NOT</code>(<code>!</code>) and "<code>-</code>" (Note: they
1210d40e9d0SAdam Hornáček        must be ALL CAPS).</li>
1220d40e9d0SAdam Hornáček</ul>
1230d25be72SVladimir Kotal<p>Regular Expression, Wildcard, Fuzzy, Proximity and Range Searches:</p>
1240d40e9d0SAdam Hornáček<ul>
1250d25be72SVladimir Kotal    <li>to perform a regular expression search use the "<code>/</code>" enclosure,
1260d40e9d0SAdam Hornáček        e.g.  /[mb]an/ - will search for man or for ban;<br/>
1270d40e9d0SAdam Hornáček        NOTE: path field search escapes "/" by default, so it only supports
1280d40e9d0SAdam Hornáček        regexps when the search string <u>starts and ends</u> with "/".<br/>
1290d25be72SVladimir Kotal        More info can be found on <a href="https://lucene.apache.org/core/<%=SearchEngine.LUCENE_VERSION_HELP%>/core/org/apache/lucene/util/automaton/RegExp.html?is-external=true">Lucene regexp page</a>.
1300d40e9d0SAdam Hornáček    </li>
1310d25be72SVladimir Kotal    <li>to perform a single character wildcard search use the "<code>?</code>" symbol,
1320d25be72SVladimir Kotal        e.g. <code>te?t</code></li>
1330d25be72SVladimir Kotal    <li>to perform a multiple character wildcard search use the "<code>*</code>"
1340d25be72SVladimir Kotal        symbol, e.g. <code>test*</code> or <code>te*t</code></li>
1350d40e9d0SAdam Hornáček    <li>you can use a * or ? symbol as the first character of a search
1360d40e9d0SAdam Hornáček        (unless not enabled using indexer option -a).</li>
1370d40e9d0SAdam Hornáček    <li>to do a fuzzy search (find words similar in spelling, based on the
1380d40e9d0SAdam Hornáček        Levenshtein Distance, or Edit Distance algorithm) use the tilde,
1390d25be72SVladimir Kotal        "<code>~</code>", e.g. rcs~ </li>
1400d40e9d0SAdam Hornáček    <li>to do a proximity search use the tilde, "~", symbol at the end of a
1410d40e9d0SAdam Hornáček        Phrase. For example to search for a "opengrok" and "help" within 10
1420d40e9d0SAdam Hornáček        words of each other enter: "opengrok help"~10 </li>
1430d40e9d0SAdam Hornáček    <li>range queries allow one to match documents whose field(s) values are
1440d40e9d0SAdam Hornáček        between the lower and upper bound specified by the Range Query. Range
1450d40e9d0SAdam Hornáček        Queries can be inclusive or exclusive of the upper and lower bounds.
1460d40e9d0SAdam Hornáček        Sorting is done lexicographically. Inclusive queries are denoted by
1470d25be72SVladimir Kotal        square brackets <code>[ ]</code> , exclusive by curly brackets <code>{ }</code>.
1480d40e9d0SAdam Hornáček        For example: title:{Aida TO Carmen} - will find all documents between
1490d40e9d0SAdam Hornáček        Aida to Carmen, exclusive of Aida and Carmen. </li>
1500d40e9d0SAdam Hornáček</ul>
1510d40e9d0SAdam Hornáček
1520d40e9d0SAdam Hornáček<a id="escaping"><dfn>Escaping special characters:</dfn></a>
1530d40e9d0SAdam Hornáček<p>
1540d40e9d0SAdam Hornáček    Opengrok supports escaping special characters that are part of the query
1550d40e9d0SAdam Hornáček    syntax. Current special characters are:<br/>
1560d25be72SVladimir Kotal    <code>+ - &amp;&amp; || ! ( ) { } [ ] ^ " ~ * ? : \ / </code><br/>
1570d40e9d0SAdam Hornáček    To escape these character use the \ before the character. For example to
1580d25be72SVladimir Kotal    search for <code>(1+1):2</code> use the query: <code>\(1\+1\)\:2</code>
1590d40e9d0SAdam Hornáček</p>
1600d40e9d0SAdam Hornáček<p>
1610d40e9d0SAdam Hornáček    NOTE on analyzers: Indexed words are made up of Alpha-Numeric and Underscore
1620d40e9d0SAdam Hornáček    characters. One letter words are usually not indexed as symbols!<br/>
1630d40e9d0SAdam Hornáček    Most other characters (including single and double quotes) are treated as
1640d40e9d0SAdam Hornáček    "spaces/whitespace" (so even if you escape them, they will not be found, since
1650d40e9d0SAdam Hornáček    most analyzers ignore them). <br/>
1660d25be72SVladimir Kotal    The exceptions are: <code>@ $ % ^ &amp; = ? . :</code> which are mostly indexed as
1670d40e9d0SAdam Hornáček    separate words.<br/>
1680d40e9d0SAdam Hornáček    Because some of them are part of the query syntax, they must be escaped with a
1690d40e9d0SAdam Hornáček    reverse slash as noted above.<br/>
1700d25be72SVladimir Kotal    So searching for <code>\+1</code> or <code>\+ 1</code> will both find <code>+1</code> and <code>+ 1</code>.
1710d40e9d0SAdam Hornáček</p>
1720d40e9d0SAdam Hornáček
1730d40e9d0SAdam Hornáček<p>Valid <dfn>FIELDs</dfn> are</p>
1740d40e9d0SAdam Hornáček<dl class="fields">
1750d40e9d0SAdam Hornáček    <dt>full</dt>
1760d40e9d0SAdam Hornáček    <dd>Search through all text tokens (words,strings,identifiers,numbers) in index.</dd>
1770d40e9d0SAdam Hornáček
1780d40e9d0SAdam Hornáček    <dt>defs</dt>
1790d40e9d0SAdam Hornáček    <dd>Only finds symbol definitions (where e.g. a variable (function, ...) is defined).</dd>
1800d40e9d0SAdam Hornáček
1810d40e9d0SAdam Hornáček    <dt>refs</dt>
1820d40e9d0SAdam Hornáček    <dd>Only finds symbols (e.g. methods, classes, functions, variables).</dd>
1830d40e9d0SAdam Hornáček
1840d40e9d0SAdam Hornáček    <dt>path</dt>
1850d40e9d0SAdam 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>
1860d40e9d0SAdam Hornáček
1870d40e9d0SAdam Hornáček    <%
1880d40e9d0SAdam Hornáček        if (PageConfig.get(request).getEnv().isHistoryEnabled()) {
1890d40e9d0SAdam Hornáček    %>
1900d40e9d0SAdam Hornáček    <dt>hist</dt>
1910d40e9d0SAdam Hornáček    <dd>History log comments.</dd>
1920d40e9d0SAdam Hornáček    <%
1930d40e9d0SAdam Hornáček        }
1940d40e9d0SAdam Hornáček    %>
1950d40e9d0SAdam Hornáček
1960d40e9d0SAdam Hornáček    <dt>type</dt>
1970d40e9d0SAdam 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>
1980d40e9d0SAdam Hornáček</dl>
1990d40e9d0SAdam Hornáček
2000d40e9d0SAdam Hornáček<p>
2010d40e9d0SAdam Hornáček    The term (phrases) can be boosted (making it more relevant) using a caret
2020d25be72SVladimir Kotal    <code>^</code> , e.g. help^4 opengrok - will make term help boosted
2030d40e9d0SAdam Hornáček</p>
2040d40e9d0SAdam Hornáček
20593480695SVladimir Kotal<p>Opengrok search is powered by <a href="https://lucene.apache.org/">Lucene</a>,
20693480695SVladimir Kotalfor more detail on query syntax refer to <a href="https://lucene.apache.org/core/<%=SearchEngine.LUCENE_VERSION_HELP%>/queryparser/org/apache/lucene/queryparser/classic/package-summary.html#package.description">Lucene docs</a>.
2070d40e9d0SAdam Hornáček</p>
2080d40e9d0SAdam Hornáček
2090d40e9d0SAdam Hornáček<h4>Intelligence Window</h4>
2100d40e9d0SAdam Hornáček<p>
2110d40e9d0SAdam HornáčekKey "1" toggles <dfn>Intelligence Window</dfn>.  It gives the user many helper actions on the last symbol pointed by the mouse cursor.
2120d40e9d0SAdam Hornáček</p>
2130a25eff5SVladimir Kotal<img src="<%= PageConfig.get(request).getCssDir() %>/img/intelli-window.png" alt="Intelligence window screenshot"/>
2140d40e9d0SAdam Hornáček
2150d40e9d0SAdam Hornáček<h5>Symbol Highlighting</h5>
2160d40e9d0SAdam Hornáček<p>
217*60ad3165SKryštof TulingerKeys "2", "3", ..., "7" toggles highlighting of the last symbol pointed by the mouse cursor.  This functionality is also accessible via the <dfn>Intelligence Window</dfn>.
2180d40e9d0SAdam Hornáček</p>
2190d40e9d0SAdam Hornáček<p>
220*60ad3165SKryštof TulingerKey "8" toggles un-highlighting all symbols. This functionality is also accessible via the <dfn>Intelligence Window</dfn>.
2210d40e9d0SAdam Hornáček</p>
2220a25eff5SVladimir Kotal<img src="<%= PageConfig.get(request).getCssDir() %>/img/symbol-highlighting.png" alt="symbol highlighting screenshot"/>
2230d40e9d0SAdam Hornáček
2240d40e9d0SAdam Hornáček<p>
2250d40e9d0SAdam Hornáček    You can close the intelligence window either by mouse in the right upper corner or by keyboard with "Esc" key.
2260d40e9d0SAdam Hornáček</p>
2270d40e9d0SAdam Hornáček
2280d40e9d0SAdam Hornáček<h5>Symbol jumping</h5>
2290d40e9d0SAdam Hornáček<p>
2300d40e9d0SAdam 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
2310d40e9d0SAdam 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.
2320d40e9d0SAdam Hornáček</p>
2330d40e9d0SAdam Hornáček
2340d40e9d0SAdam Hornáček<h4>Diff jumper</h4>
2350d40e9d0SAdam Hornáček
2360d40e9d0SAdam Hornáček<p>
2370d40e9d0SAdam 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.
2380d40e9d0SAdam Hornáček</p>
2390a25eff5SVladimir Kotal<img src="<%= PageConfig.get(request).getCssDir() %>/img/diff-jumper.png" alt="diff jumper screenshot"/>
2400d40e9d0SAdam Hornáček
2410d40e9d0SAdam Hornáček<h5>Mouse and keyboard navigation</h5>
2420d40e9d0SAdam Hornáček<p>
2430d40e9d0SAdam 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,
2440d40e9d0SAdam 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.
2450d40e9d0SAdam Hornáček</p>
2460a25eff5SVladimir Kotal<img src="<%= PageConfig.get(request).getCssDir() %>/img/diff-jumping.png" alt="screenshot of diff jumper in action"/>
2470d40e9d0SAdam Hornáček
2480d40e9d0SAdam Hornáček        </div>
2490d40e9d0SAdam Hornáček<%
2500d40e9d0SAdam Hornáček/* ---------------------- help.jsp end --------------------- */
2510d40e9d0SAdam Hornáček%><%@
2520d40e9d0SAdam Hornáček
2530d40e9d0SAdam Hornáčekinclude file="foot.jspf"
2540d40e9d0SAdam Hornáček
2550d40e9d0SAdam Hornáček%>
256