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>. 22a804b2d7SAdam Hornáček--%> 23a804b2d7SAdam Hornáček<%@page contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%> 24a804b2d7SAdam Hornáček<%@page session="false" errorPage="error.jsp" import=" 251c830032SChris Fraireorg.opengrok.indexer.search.SearchEngine, 26d8a7afe2SAdam Hornacekorg.opengrok.web.PageConfig, 271c830032SChris Fraireorg.opengrok.indexer.web.QueryParameters" 281c830032SChris Fraire%> 291c830032SChris Fraire<% 300d40e9d0SAdam Hornáček/* ---------------------- help.jsp start --------------------- */ 310d40e9d0SAdam Hornáček{ 320d40e9d0SAdam Hornáček PageConfig cfg = PageConfig.get(request); 330d40e9d0SAdam Hornáček cfg.checkSourceRootExistence(); 340d40e9d0SAdam Hornáček cfg.setTitle("OpenGrok Help"); 350d40e9d0SAdam Hornáček} 360d40e9d0SAdam Hornáček%><%@ 370d40e9d0SAdam Hornáček 380d40e9d0SAdam Hornáčekinclude file="httpheader.jspf" 390d40e9d0SAdam Hornáček 400d40e9d0SAdam Hornáček%> 410d40e9d0SAdam Hornáček<body> 420d40e9d0SAdam Hornáček <div id="page"> 43aa18fa28SAdam Hornacek <header id="whole_header"> 44aa18fa28SAdam Hornacek <%@include file="pageheader.jspf" %> 450d40e9d0SAdam Hornáček <div id="Masthead">Help page</div> 46aa18fa28SAdam Hornacek </header> 470d40e9d0SAdam Hornáček <div id="sbar"> 480d40e9d0SAdam Hornáček <div id="menu"><%@ 490d40e9d0SAdam Hornáček 500d40e9d0SAdam Hornáčekinclude file="menu.jspf" 510d40e9d0SAdam Hornáček 520d40e9d0SAdam Hornáček%> 530d40e9d0SAdam Hornáček </div> 540d40e9d0SAdam Hornáček </div> 550d40e9d0SAdam Hornáček <div id="help"> 560d40e9d0SAdam Hornáček 570d40e9d0SAdam Hornáček<h4>Examples:</h4> 580d40e9d0SAdam Hornáček<pre class="example"> 590d40e9d0SAdam Hornáček 600d40e9d0SAdam HornáčekTo find where setResourceMonitors is defined: 611c830032SChris Fraire<a href="search?<%= QueryParameters.FULL_SEARCH_PARAM_EQ %>& 621c830032SChris Fraire<%= QueryParameters.DEFS_SEARCH_PARAM_EQ %>setResourceMonitors"> 631c830032SChris Fraire <%= QueryBuilder.DEFS %>:setResourceMonitors</a> 640d40e9d0SAdam Hornáček 650d40e9d0SAdam HornáčekTo find files that use sprintf in usr/src/cmd/cmd-inet/usr.sbin/: 661c830032SChris Fraire<a href="search?<%= QueryParameters.REFS_SEARCH_PARAM_EQ %>sprintf& 671c830032SChris Fraire<%= QueryParameters.PATH_SEARCH_PARAM_EQ %>usr%2Fsrc%2Fcmd%2Fcmd-inet%2Fusr.sbin%2F" 681c830032SChris Fraire><%= QueryBuilder.REFS %>:sprintf <%= QueryBuilder.PATH %>:usr/src/cmd/cmd-inet/usr.sbin</a> 690d40e9d0SAdam Hornáček 700d40e9d0SAdam HornáčekTo find assignments to variable foo: 711c830032SChris Fraire<a href="search?<%= QueryParameters.FULL_SEARCH_PARAM_EQ %>%22foo+%3D%22">"foo ="</a> 720d40e9d0SAdam Hornáček 730d40e9d0SAdam HornáčekTo find Makefiles where pstack binary is being built: 741c830032SChris Fraire<a href="search?<%= QueryParameters.FULL_SEARCH_PARAM_EQ %>pstack& 751c830032SChris Fraire<%= QueryParameters.PATH_SEARCH_PARAM_EQ %>Makefile">pstack <%= QueryBuilder.PATH %>:Makefile</a> 760d40e9d0SAdam Hornáček 770d40e9d0SAdam Hornáčekto search for phrase "Bill Joy": 781c830032SChris Fraire<a href="search?<%= QueryParameters.FULL_SEARCH_PARAM_EQ %>%22Bill+Joy%22">"Bill Joy"</a> 790d40e9d0SAdam Hornáček 800d40e9d0SAdam HornáčekTo find perl files that do not use /usr/bin/perl but something else: 811c830032SChris Fraire<a href="search?<%= QueryParameters.FULL_SEARCH_PARAM_EQ %>-%22%2Fusr%2Fbin%2Fperl%22+%2B%22%2Fbin%2Fperl%22" 820d40e9d0SAdam Hornáček>-"/usr/bin/perl" +"/bin/perl"</a> 830d40e9d0SAdam Hornáček 840d40e9d0SAdam HornáčekTo find all strings beginning with foo use the wildcard: 851c830032SChris Fraire<a href="search?<%= QueryParameters.FULL_SEARCH_PARAM_EQ %>foo*">foo*</a> 860d40e9d0SAdam Hornáček 870d40e9d0SAdam HornáčekTo find all files which have . c in their name (dot is a token!): 881c830032SChris Fraire<a href="search?<%= QueryParameters.PATH_SEARCH_PARAM_EQ %>%22. c%22">". c"</a> 890d40e9d0SAdam Hornáček 900d40e9d0SAdam HornáčekTo find all files which start with "ma" and then have only alphabet characters do: 911c830032SChris Fraire<a href="search?<%= QueryParameters.PATH_SEARCH_PARAM_EQ %>/ma[a-zA-Z]*/"> 921c830032SChris Fraire <%= QueryBuilder.PATH %>:/ma[a-zA-Z]*/</a> 930d40e9d0SAdam Hornáček 940d40e9d0SAdam HornáčekTo find all main methods in all files analyzed by C analyzer (so .c, .h, ...) do: 951c830032SChris Fraire<a href="search?<%= QueryParameters.FULL_SEARCH_PARAM_EQ %>main& 961c830032SChris Fraire<%= QueryParameters.TYPE_SEARCH_PARAM_EQ %>c">main <%= QueryBuilder.TYPE %>:c</a> 970d40e9d0SAdam Hornáček</pre> 980d40e9d0SAdam Hornáček 990d40e9d0SAdam Hornáček<h4>More info:</h4> 1000d40e9d0SAdam HornáčekA <dfn>Query</dfn> is a series of clauses. A clause may be prefixed by: 1010d40e9d0SAdam Hornáček<ul> 102839ed69dSVladimir Kotal <li>a plus "<strong>+</strong>" or a minus "<strong>-</strong>" sign, indicating that the clause 1030d40e9d0SAdam Hornáček is required or prohibited respectively; or</li> 104839ed69dSVladimir Kotal <li>a <dfn>term</dfn> followed by a colon "<strong>:</strong>", indicating the 1050d40e9d0SAdam Hornáček <dfn>field</dfn> to be searched. This enables one to construct queries 1060d40e9d0SAdam Hornáček which search multiple <dfn>fields</dfn>.</li> 1070d40e9d0SAdam Hornáček</ul> 1080d40e9d0SAdam Hornáček<p>A <dfn>clause</dfn> may be either:</p> 1090d40e9d0SAdam Hornáček<ul> 1100d40e9d0SAdam Hornáček <li>a <dfn>term</dfn>, indicating all the documents that contain this term; 1110d40e9d0SAdam Hornáček or</li> 1120d40e9d0SAdam Hornáček <li>a <dfn>phrase</dfn> - group of words surrounded by double quotes 113839ed69dSVladimir Kotal <strong>" "</strong>, e.g. "hello dolly" </li> 114839ed69dSVladimir Kotal <li>a nested query, enclosed in parentheses "<strong>(</strong>" "<strong>)</strong>" (also 1150d40e9d0SAdam Hornáček called query/field <dfn>grouping</dfn>) . Note that this may be used 1160d40e9d0SAdam Hornáček with a +/- prefix to require any of a set of terms. </li> 1170d40e9d0SAdam Hornáček <li>boolean <dfn>operators</dfn> which allow terms to be combined through 118839ed69dSVladimir Kotal logic operators. Supported are <strong>AND</strong>(<strong>&&</strong>), "<strong>+</strong>", 119839ed69dSVladimir Kotal <strong>OR</strong>(<strong>||</strong>), <strong>NOT</strong>(<strong>!</strong>) and "<strong>-</strong>" (Note: they 1200d40e9d0SAdam Hornáček must be ALL CAPS).</li> 1210d40e9d0SAdam Hornáček</ul> 1220d40e9d0SAdam Hornáček<p>Regular Expression, Wildcard, Fuzzy, Proximity & Range Searches:</p> 1230d40e9d0SAdam Hornáček<ul> 124839ed69dSVladimir Kotal <li>to perform a regular expression search use the "<strong>/</strong>" enclosure, 1250d40e9d0SAdam Hornáček e.g. /[mb]an/ - will search for man or for ban;<br/> 1260d40e9d0SAdam Hornáček NOTE: path field search escapes "/" by default, so it only supports 1270d40e9d0SAdam Hornáček regexps when the search string <u>starts and ends</u> with "/".<br/> 1280d40e9d0SAdam 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>. 1290d40e9d0SAdam Hornáček </li> 130839ed69dSVladimir Kotal <li>to perform a single character wildcard search use the "<strong>?</strong>" symbol, 1310d40e9d0SAdam Hornáček e.g. te?t</li> 132839ed69dSVladimir Kotal <li>to perform a multiple character wildcard search use the "<strong>*</strong>" 1330d40e9d0SAdam Hornáček symbol, e.g. test* or te*t</li> 1340d40e9d0SAdam Hornáček <li>you can use a * or ? symbol as the first character of a search 1350d40e9d0SAdam Hornáček (unless not enabled using indexer option -a).</li> 1360d40e9d0SAdam Hornáček <li>to do a fuzzy search (find words similar in spelling, based on the 1370d40e9d0SAdam Hornáček Levenshtein Distance, or Edit Distance algorithm) use the tilde, 138839ed69dSVladimir Kotal "<strong>~</strong>", e.g. rcs~ </li> 1390d40e9d0SAdam Hornáček <li>to do a proximity search use the tilde, "~", symbol at the end of a 1400d40e9d0SAdam Hornáček Phrase. For example to search for a "opengrok" and "help" within 10 1410d40e9d0SAdam Hornáček words of each other enter: "opengrok help"~10 </li> 1420d40e9d0SAdam Hornáček <li>range queries allow one to match documents whose field(s) values are 1430d40e9d0SAdam Hornáček between the lower and upper bound specified by the Range Query. Range 1440d40e9d0SAdam Hornáček Queries can be inclusive or exclusive of the upper and lower bounds. 1450d40e9d0SAdam Hornáček Sorting is done lexicographically. Inclusive queries are denoted by 146839ed69dSVladimir Kotal square brackets <strong>[ ]</strong> , exclusive by curly brackets <strong>{ }</strong>. 1470d40e9d0SAdam Hornáček For example: title:{Aida TO Carmen} - will find all documents between 1480d40e9d0SAdam Hornáček Aida to Carmen, exclusive of Aida and Carmen. </li> 1490d40e9d0SAdam Hornáček</ul> 1500d40e9d0SAdam Hornáček 1510d40e9d0SAdam Hornáček<a id="escaping"><dfn>Escaping special characters:</dfn></a> 1520d40e9d0SAdam Hornáček<p> 1530d40e9d0SAdam Hornáček Opengrok supports escaping special characters that are part of the query 1540d40e9d0SAdam Hornáček syntax. Current special characters are:<br/> 155839ed69dSVladimir Kotal <strong>+ - && || ! ( ) { } [ ] ^ " ~ * ? : \ / </strong><br/> 1560d40e9d0SAdam Hornáček To escape these character use the \ before the character. For example to 157839ed69dSVladimir Kotal search for <strong>(1+1):2</strong> use the query: <strong>\(1\+1\)\:2</strong> 1580d40e9d0SAdam Hornáček</p> 1590d40e9d0SAdam Hornáček<p> 1600d40e9d0SAdam Hornáček NOTE on analyzers: Indexed words are made up of Alpha-Numeric and Underscore 1610d40e9d0SAdam Hornáček characters. One letter words are usually not indexed as symbols!<br/> 1620d40e9d0SAdam Hornáček Most other characters (including single and double quotes) are treated as 1630d40e9d0SAdam Hornáček "spaces/whitespace" (so even if you escape them, they will not be found, since 1640d40e9d0SAdam Hornáček most analyzers ignore them). <br/> 165839ed69dSVladimir Kotal The exceptions are: <strong>@ $ % ^ & = ? . :</strong> which are mostly indexed as 1660d40e9d0SAdam Hornáček separate words.<br/> 1670d40e9d0SAdam Hornáček Because some of them are part of the query syntax, they must be escaped with a 1680d40e9d0SAdam Hornáček reverse slash as noted above.<br/> 169839ed69dSVladimir Kotal So searching for <strong>\+1</strong> or <strong>\+ 1</strong> will both find <strong>+1</strong> and <strong>+ 1</strong>. 1700d40e9d0SAdam Hornáček</p> 1710d40e9d0SAdam Hornáček 1720d40e9d0SAdam Hornáček<p>Valid <dfn>FIELDs</dfn> are</p> 1730d40e9d0SAdam Hornáček<dl class="fields"> 1740d40e9d0SAdam Hornáček <dt>full</dt> 1750d40e9d0SAdam Hornáček <dd>Search through all text tokens (words,strings,identifiers,numbers) in index.</dd> 1760d40e9d0SAdam Hornáček 1770d40e9d0SAdam Hornáček <dt>defs</dt> 1780d40e9d0SAdam Hornáček <dd>Only finds symbol definitions (where e.g. a variable (function, ...) is defined).</dd> 1790d40e9d0SAdam Hornáček 1800d40e9d0SAdam Hornáček <dt>refs</dt> 1810d40e9d0SAdam Hornáček <dd>Only finds symbols (e.g. methods, classes, functions, variables).</dd> 1820d40e9d0SAdam Hornáček 1830d40e9d0SAdam Hornáček <dt>path</dt> 1840d40e9d0SAdam 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> 1850d40e9d0SAdam Hornáček 1860d40e9d0SAdam Hornáček <% 1870d40e9d0SAdam Hornáček if (PageConfig.get(request).getEnv().isHistoryEnabled()) { 1880d40e9d0SAdam Hornáček %> 1890d40e9d0SAdam Hornáček <dt>hist</dt> 1900d40e9d0SAdam Hornáček <dd>History log comments.</dd> 1910d40e9d0SAdam Hornáček <% 1920d40e9d0SAdam Hornáček } 1930d40e9d0SAdam Hornáček %> 1940d40e9d0SAdam Hornáček 1950d40e9d0SAdam Hornáček <dt>type</dt> 1960d40e9d0SAdam 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> 1970d40e9d0SAdam Hornáček</dl> 1980d40e9d0SAdam Hornáček 1990d40e9d0SAdam Hornáček<p> 2000d40e9d0SAdam Hornáček The term (phrases) can be boosted (making it more relevant) using a caret 201839ed69dSVladimir Kotal <strong>^</strong> , e.g. help^4 opengrok - will make term help boosted 2020d40e9d0SAdam Hornáček</p> 2030d40e9d0SAdam Hornáček 20493480695SVladimir Kotal<p>Opengrok search is powered by <a href="https://lucene.apache.org/">Lucene</a>, 20593480695SVladimir 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>. 2060d40e9d0SAdam Hornáček</p> 2070d40e9d0SAdam Hornáček 2080d40e9d0SAdam Hornáček<h4>Intelligence Window</h4> 2090d40e9d0SAdam Hornáček<p> 2100d40e9d0SAdam HornáčekKey "1" toggles <dfn>Intelligence Window</dfn>. It gives the user many helper actions on the last symbol pointed by the mouse cursor. 2110d40e9d0SAdam Hornáček</p> 212*0a25eff5SVladimir Kotal<img src="<%= PageConfig.get(request).getCssDir() %>/img/intelli-window.png" alt="Intelligence window screenshot"/> 2130d40e9d0SAdam Hornáček 2140d40e9d0SAdam Hornáček<h5>Symbol Highlighting</h5> 2150d40e9d0SAdam Hornáček<p> 2160d40e9d0SAdam 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>. 2170d40e9d0SAdam Hornáček</p> 2180d40e9d0SAdam Hornáček<p> 219*0a25eff5SVladimir KotalKey "5" toggles un-highlighting all symbols. This functionality is also accessible via the <dfn>Intelligence Window</dfn>. 2200d40e9d0SAdam Hornáček</p> 221*0a25eff5SVladimir Kotal<img src="<%= PageConfig.get(request).getCssDir() %>/img/symbol-highlighting.png" alt="symbol highlighting screenshot"/> 2220d40e9d0SAdam Hornáček 2230d40e9d0SAdam Hornáček<p> 2240d40e9d0SAdam Hornáček You can close the intelligence window either by mouse in the right upper corner or by keyboard with "Esc" key. 2250d40e9d0SAdam Hornáček</p> 2260d40e9d0SAdam Hornáček 2270d40e9d0SAdam Hornáček<h5>Symbol jumping</h5> 2280d40e9d0SAdam Hornáček<p> 2290d40e9d0SAdam 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 2300d40e9d0SAdam 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. 2310d40e9d0SAdam Hornáček</p> 2320d40e9d0SAdam Hornáček 2330d40e9d0SAdam Hornáček<h4>Diff jumper</h4> 2340d40e9d0SAdam Hornáček 2350d40e9d0SAdam Hornáček<p> 2360d40e9d0SAdam 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. 2370d40e9d0SAdam Hornáček</p> 238*0a25eff5SVladimir Kotal<img src="<%= PageConfig.get(request).getCssDir() %>/img/diff-jumper.png" alt="diff jumper screenshot"/> 2390d40e9d0SAdam Hornáček 2400d40e9d0SAdam Hornáček<h5>Mouse and keyboard navigation</h5> 2410d40e9d0SAdam Hornáček<p> 2420d40e9d0SAdam 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, 2430d40e9d0SAdam 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. 2440d40e9d0SAdam Hornáček</p> 245*0a25eff5SVladimir Kotal<img src="<%= PageConfig.get(request).getCssDir() %>/img/diff-jumping.png" alt="screenshot of diff jumper in action"/> 2460d40e9d0SAdam Hornáček 2470d40e9d0SAdam Hornáček </div> 2480d40e9d0SAdam Hornáček<% 2490d40e9d0SAdam Hornáček/* ---------------------- help.jsp end --------------------- */ 2500d40e9d0SAdam Hornáček%><%@ 2510d40e9d0SAdam Hornáček 2520d40e9d0SAdam Hornáčekinclude file="foot.jspf" 2530d40e9d0SAdam Hornáček 2540d40e9d0SAdam Hornáček%> 255