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