1*0d40e9d0SAdam Hornáček<%-- 2*0d40e9d0SAdam HornáčekCDDL HEADER START 3*0d40e9d0SAdam Hornáček 4*0d40e9d0SAdam HornáčekThe contents of this file are subject to the terms of the 5*0d40e9d0SAdam HornáčekCommon Development and Distribution License (the "License"). 6*0d40e9d0SAdam HornáčekYou may not use this file except in compliance with the License. 7*0d40e9d0SAdam Hornáček 8*0d40e9d0SAdam HornáčekSee LICENSE.txt included in this distribution for the specific 9*0d40e9d0SAdam Hornáčeklanguage governing permissions and limitations under the License. 10*0d40e9d0SAdam Hornáček 11*0d40e9d0SAdam HornáčekWhen distributing Covered Code, include this CDDL HEADER in each 12*0d40e9d0SAdam Hornáčekfile and include the License file at LICENSE.txt. 13*0d40e9d0SAdam HornáčekIf applicable, add the following below this CDDL HEADER, with the 14*0d40e9d0SAdam Hornáčekfields enclosed by brackets "[]" replaced with your own identifying 15*0d40e9d0SAdam Hornáčekinformation: Portions Copyright [yyyy] [name of copyright owner] 16*0d40e9d0SAdam Hornáček 17*0d40e9d0SAdam HornáčekCDDL HEADER END 18*0d40e9d0SAdam Hornáček 19*0d40e9d0SAdam HornáčekCopyright (c) 2005, 2017, Oracle and/or its affiliates. All rights reserved. 20*0d40e9d0SAdam Hornáček 21*0d40e9d0SAdam HornáčekPortions Copyright 2011 Jens Elkner. 22*0d40e9d0SAdam Hornáček 23*0d40e9d0SAdam Hornáček--%><%@ page session="false" errorPage="error.jsp" import=" 24*0d40e9d0SAdam Hornáčekorg.opensolaris.opengrok.web.PageConfig, 25*0d40e9d0SAdam Hornáčekorg.opensolaris.opengrok.search.SearchEngine" 26*0d40e9d0SAdam Hornáček%><% 27*0d40e9d0SAdam Hornáček/* ---------------------- help.jsp start --------------------- */ 28*0d40e9d0SAdam Hornáček{ 29*0d40e9d0SAdam Hornáček PageConfig cfg = PageConfig.get(request); 30*0d40e9d0SAdam Hornáček cfg.checkSourceRootExistence(); 31*0d40e9d0SAdam Hornáček cfg.setTitle("OpenGrok Help"); 32*0d40e9d0SAdam Hornáček} 33*0d40e9d0SAdam Hornáček%><%@ 34*0d40e9d0SAdam Hornáček 35*0d40e9d0SAdam Hornáčekinclude file="httpheader.jspf" 36*0d40e9d0SAdam Hornáček 37*0d40e9d0SAdam Hornáček%> 38*0d40e9d0SAdam Hornáček<body> 39*0d40e9d0SAdam Hornáček <div id="page"> 40*0d40e9d0SAdam Hornáček <div id="whole_header"> 41*0d40e9d0SAdam Hornáček <div id="header"><%@ 42*0d40e9d0SAdam Hornáček 43*0d40e9d0SAdam Hornáčekinclude file="pageheader.jspf" 44*0d40e9d0SAdam Hornáček 45*0d40e9d0SAdam Hornáček %></div> 46*0d40e9d0SAdam Hornáček <div id="Masthead">Help page</div> 47*0d40e9d0SAdam Hornáček </div> 48*0d40e9d0SAdam Hornáček <div id="sbar"> 49*0d40e9d0SAdam Hornáček <div id="menu"><%@ 50*0d40e9d0SAdam Hornáček 51*0d40e9d0SAdam Hornáčekinclude file="menu.jspf" 52*0d40e9d0SAdam Hornáček 53*0d40e9d0SAdam Hornáček%> 54*0d40e9d0SAdam Hornáček </div> 55*0d40e9d0SAdam Hornáček </div> 56*0d40e9d0SAdam Hornáček <div id="help"> 57*0d40e9d0SAdam Hornáček 58*0d40e9d0SAdam Hornáček<h4>Examples:</h4> 59*0d40e9d0SAdam Hornáček<pre class="example"> 60*0d40e9d0SAdam Hornáček 61*0d40e9d0SAdam HornáčekTo find where setResourceMonitors is defined: 62*0d40e9d0SAdam Hornáček<a href="search?q=&defs=setResourceMonitors">defs:setResourceMonitors</a> 63*0d40e9d0SAdam Hornáček 64*0d40e9d0SAdam HornáčekTo find files that use sprintf in usr/src/cmd/cmd-inet/usr.sbin/: 65*0d40e9d0SAdam Hornáček<a href="search?refs=sprintf&path=usr%2Fsrc%2Fcmd%2Fcmd-inet%2Fusr.sbin%2F" 66*0d40e9d0SAdam Hornáček>refs:sprintf path:usr/src/cmd/cmd-inet/usr.sbin</a> 67*0d40e9d0SAdam Hornáček 68*0d40e9d0SAdam HornáčekTo find assignments to variable foo: 69*0d40e9d0SAdam Hornáček<a href="search?q=%22foo+%3D%22">"foo ="</a> 70*0d40e9d0SAdam Hornáček 71*0d40e9d0SAdam HornáčekTo find Makefiles where pstack binary is being built: 72*0d40e9d0SAdam Hornáček<a href="search?q=pstack&path=Makefile">pstack path:Makefile</a> 73*0d40e9d0SAdam Hornáček 74*0d40e9d0SAdam Hornáčekto search for phrase "Bill Joy": 75*0d40e9d0SAdam Hornáček<a href="search?q=%22Bill+Joy%22">"Bill Joy"</a> 76*0d40e9d0SAdam Hornáček 77*0d40e9d0SAdam HornáčekTo find perl files that do not use /usr/bin/perl but something else: 78*0d40e9d0SAdam Hornáček<a href="search?q=-%22%2Fusr%2Fbin%2Fperl%22+%2B%22%2Fbin%2Fperl%22" 79*0d40e9d0SAdam Hornáček>-"/usr/bin/perl" +"/bin/perl"</a> 80*0d40e9d0SAdam Hornáček 81*0d40e9d0SAdam HornáčekTo find all strings beginning with foo use the wildcard: 82*0d40e9d0SAdam Hornáček<a href="search?q=foo*">foo*</a> 83*0d40e9d0SAdam Hornáček 84*0d40e9d0SAdam HornáčekTo find all files which have . c in their name (dot is a token!): 85*0d40e9d0SAdam Hornáček<a href="search?path=%22. c%22">". c"</a> 86*0d40e9d0SAdam Hornáček 87*0d40e9d0SAdam HornáčekTo find all files which start with "ma" and then have only alphabet characters do: 88*0d40e9d0SAdam Hornáček<a href="search?path=/ma[a-zA-Z]*/">path:/ma[a-zA-Z]*/</a> 89*0d40e9d0SAdam Hornáček 90*0d40e9d0SAdam HornáčekTo find all main methods in all files analyzed by C analyzer (so .c, .h, ...) do: 91*0d40e9d0SAdam Hornáček<a href="search?q=main&type=c">main type:c</a> 92*0d40e9d0SAdam Hornáček</pre> 93*0d40e9d0SAdam Hornáček 94*0d40e9d0SAdam Hornáček<h4>More info:</h4> 95*0d40e9d0SAdam HornáčekA <dfn>Query</dfn> is a series of clauses. A clause may be prefixed by: 96*0d40e9d0SAdam Hornáček<ul> 97*0d40e9d0SAdam Hornáček <li>a plus "<b>+</b>" or a minus "<b>-</b>" sign, indicating that the clause 98*0d40e9d0SAdam Hornáček is required or prohibited respectively; or</li> 99*0d40e9d0SAdam Hornáček <li>a <dfn>term</dfn> followed by a colon "<b>:</b>", indicating the 100*0d40e9d0SAdam Hornáček <dfn>field</dfn> to be searched. This enables one to construct queries 101*0d40e9d0SAdam Hornáček which search multiple <dfn>fields</dfn>.</li> 102*0d40e9d0SAdam Hornáček</ul> 103*0d40e9d0SAdam Hornáček<p>A <dfn>clause</dfn> may be either:</p> 104*0d40e9d0SAdam Hornáček<ul> 105*0d40e9d0SAdam Hornáček <li>a <dfn>term</dfn>, indicating all the documents that contain this term; 106*0d40e9d0SAdam Hornáček or</li> 107*0d40e9d0SAdam Hornáček <li>a <dfn>phrase</dfn> - group of words surrounded by double quotes 108*0d40e9d0SAdam Hornáček <b>" "</b>, e.g. "hello dolly" </li> 109*0d40e9d0SAdam Hornáček <li>a nested query, enclosed in parentheses "<b>(</b>" "<b>)</b>" (also 110*0d40e9d0SAdam Hornáček called query/field <dfn>grouping</dfn>) . Note that this may be used 111*0d40e9d0SAdam Hornáček with a +/- prefix to require any of a set of terms. </li> 112*0d40e9d0SAdam Hornáček <li>boolean <dfn>operators</dfn> which allow terms to be combined through 113*0d40e9d0SAdam Hornáček logic operators. Supported are <b>AND</b>(<b>&&</b>), "<b>+</b>", 114*0d40e9d0SAdam Hornáček <b>OR</b>(<b>||</b>), <b>NOT</b>(<b>!</b>) and "<b>-</b>" (Note: they 115*0d40e9d0SAdam Hornáček must be ALL CAPS).</li> 116*0d40e9d0SAdam Hornáček</ul> 117*0d40e9d0SAdam Hornáček<p>Regular Expression, Wildcard, Fuzzy, Proximity & Range Searches:</p> 118*0d40e9d0SAdam Hornáček<ul> 119*0d40e9d0SAdam Hornáček <li>to perform a regular expression search use the "<b>/</b>" enclosure, 120*0d40e9d0SAdam Hornáček e.g. /[mb]an/ - will search for man or for ban;<br/> 121*0d40e9d0SAdam Hornáček NOTE: path field search escapes "/" by default, so it only supports 122*0d40e9d0SAdam Hornáček regexps when the search string <u>starts and ends</u> with "/".<br/> 123*0d40e9d0SAdam 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>. 124*0d40e9d0SAdam Hornáček </li> 125*0d40e9d0SAdam Hornáček <li>to perform a single character wildcard search use the "<b>?</b>" symbol, 126*0d40e9d0SAdam Hornáček e.g. te?t</li> 127*0d40e9d0SAdam Hornáček <li>to perform a multiple character wildcard search use the "<b>*</b>" 128*0d40e9d0SAdam Hornáček symbol, e.g. test* or te*t</li> 129*0d40e9d0SAdam Hornáček <li>you can use a * or ? symbol as the first character of a search 130*0d40e9d0SAdam Hornáček (unless not enabled using indexer option -a).</li> 131*0d40e9d0SAdam Hornáček <li>to do a fuzzy search (find words similar in spelling, based on the 132*0d40e9d0SAdam Hornáček Levenshtein Distance, or Edit Distance algorithm) use the tilde, 133*0d40e9d0SAdam Hornáček "<b>~</b>", e.g. rcs~ </li> 134*0d40e9d0SAdam Hornáček <li>to do a proximity search use the tilde, "~", symbol at the end of a 135*0d40e9d0SAdam Hornáček Phrase. For example to search for a "opengrok" and "help" within 10 136*0d40e9d0SAdam Hornáček words of each other enter: "opengrok help"~10 </li> 137*0d40e9d0SAdam Hornáček <li>range queries allow one to match documents whose field(s) values are 138*0d40e9d0SAdam Hornáček between the lower and upper bound specified by the Range Query. Range 139*0d40e9d0SAdam Hornáček Queries can be inclusive or exclusive of the upper and lower bounds. 140*0d40e9d0SAdam Hornáček Sorting is done lexicographically. Inclusive queries are denoted by 141*0d40e9d0SAdam Hornáček square brackets <b>[ ]</b> , exclusive by curly brackets <b>{ }</b>. 142*0d40e9d0SAdam Hornáček For example: title:{Aida TO Carmen} - will find all documents between 143*0d40e9d0SAdam Hornáček Aida to Carmen, exclusive of Aida and Carmen. </li> 144*0d40e9d0SAdam Hornáček</ul> 145*0d40e9d0SAdam Hornáček 146*0d40e9d0SAdam Hornáček<a id="escaping"><dfn>Escaping special characters:</dfn></a> 147*0d40e9d0SAdam Hornáček<p> 148*0d40e9d0SAdam Hornáček Opengrok supports escaping special characters that are part of the query 149*0d40e9d0SAdam Hornáček syntax. Current special characters are:<br/> 150*0d40e9d0SAdam Hornáček <b>+ - && || ! ( ) { } [ ] ^ " ~ * ? : \ / </b><br/> 151*0d40e9d0SAdam Hornáček To escape these character use the \ before the character. For example to 152*0d40e9d0SAdam Hornáček search for <b>(1+1):2</b> use the query: <b>\(1\+1\)\:2</b> 153*0d40e9d0SAdam Hornáček</p> 154*0d40e9d0SAdam Hornáček<p> 155*0d40e9d0SAdam Hornáček NOTE on analyzers: Indexed words are made up of Alpha-Numeric and Underscore 156*0d40e9d0SAdam Hornáček characters. One letter words are usually not indexed as symbols!<br/> 157*0d40e9d0SAdam Hornáček Most other characters (including single and double quotes) are treated as 158*0d40e9d0SAdam Hornáček "spaces/whitespace" (so even if you escape them, they will not be found, since 159*0d40e9d0SAdam Hornáček most analyzers ignore them). <br/> 160*0d40e9d0SAdam Hornáček The exceptions are: <b>@ $ % ^ & = ? . :</b> which are mostly indexed as 161*0d40e9d0SAdam Hornáček separate words.<br/> 162*0d40e9d0SAdam Hornáček Because some of them are part of the query syntax, they must be escaped with a 163*0d40e9d0SAdam Hornáček reverse slash as noted above.<br/> 164*0d40e9d0SAdam Hornáček So searching for <b>\+1</b> or <b>\+ 1</b> will both find <b>+1</b> and <b>+ 1</b>. 165*0d40e9d0SAdam Hornáček</p> 166*0d40e9d0SAdam Hornáček 167*0d40e9d0SAdam Hornáček<p>Valid <dfn>FIELDs</dfn> are</p> 168*0d40e9d0SAdam Hornáček<dl class="fields"> 169*0d40e9d0SAdam Hornáček <dt>full</dt> 170*0d40e9d0SAdam Hornáček <dd>Search through all text tokens (words,strings,identifiers,numbers) in index.</dd> 171*0d40e9d0SAdam Hornáček 172*0d40e9d0SAdam Hornáček <dt>defs</dt> 173*0d40e9d0SAdam Hornáček <dd>Only finds symbol definitions (where e.g. a variable (function, ...) is defined).</dd> 174*0d40e9d0SAdam Hornáček 175*0d40e9d0SAdam Hornáček <dt>refs</dt> 176*0d40e9d0SAdam Hornáček <dd>Only finds symbols (e.g. methods, classes, functions, variables).</dd> 177*0d40e9d0SAdam Hornáček 178*0d40e9d0SAdam Hornáček <dt>path</dt> 179*0d40e9d0SAdam 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> 180*0d40e9d0SAdam Hornáček 181*0d40e9d0SAdam Hornáček <% 182*0d40e9d0SAdam Hornáček if (PageConfig.get(request).getEnv().isHistoryEnabled()) { 183*0d40e9d0SAdam Hornáček %> 184*0d40e9d0SAdam Hornáček <dt>hist</dt> 185*0d40e9d0SAdam Hornáček <dd>History log comments.</dd> 186*0d40e9d0SAdam Hornáček <% 187*0d40e9d0SAdam Hornáček } 188*0d40e9d0SAdam Hornáček %> 189*0d40e9d0SAdam Hornáček 190*0d40e9d0SAdam Hornáček <dt>type</dt> 191*0d40e9d0SAdam 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> 192*0d40e9d0SAdam Hornáček</dl> 193*0d40e9d0SAdam Hornáček 194*0d40e9d0SAdam Hornáček<p> 195*0d40e9d0SAdam Hornáček The term (phrases) can be boosted (making it more relevant) using a caret 196*0d40e9d0SAdam Hornáček <b>^</b> , e.g. help^4 opengrok - will make term help boosted 197*0d40e9d0SAdam Hornáček</p> 198*0d40e9d0SAdam Hornáček 199*0d40e9d0SAdam Hornáček<p>Opengrok search is powered by <a href="http://lucene.apache.org/">Lucene</a>, 200*0d40e9d0SAdam 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>. 201*0d40e9d0SAdam Hornáček</p> 202*0d40e9d0SAdam Hornáček 203*0d40e9d0SAdam Hornáček<h4>Intelligence Window</h4> 204*0d40e9d0SAdam Hornáček<p> 205*0d40e9d0SAdam HornáčekKey "1" toggles <dfn>Intelligence Window</dfn>. It gives the user many helper actions on the last symbol pointed by the mouse cursor. 206*0d40e9d0SAdam Hornáček</p> 207*0d40e9d0SAdam Hornáček<img src="<%= PageConfig.get(request).getCssDir() %>/img/intelli-window.png"/> 208*0d40e9d0SAdam Hornáček 209*0d40e9d0SAdam Hornáček<h5>Symbol Highlighting</h5> 210*0d40e9d0SAdam Hornáček<p> 211*0d40e9d0SAdam 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>. 212*0d40e9d0SAdam Hornáček</p> 213*0d40e9d0SAdam Hornáček<p> 214*0d40e9d0SAdam HornáčekKey "5" toggles unhighlighting all symbols. This functionality is also accessible via the <dfn>Intelligence Window</dfn>. 215*0d40e9d0SAdam Hornáček</p> 216*0d40e9d0SAdam Hornáček<img src="<%= PageConfig.get(request).getCssDir() %>/img/symbol-highlighting.png"/> 217*0d40e9d0SAdam Hornáček 218*0d40e9d0SAdam Hornáček<p> 219*0d40e9d0SAdam Hornáček You can close the intelligence window either by mouse in the right upper corner or by keyboard with "Esc" key. 220*0d40e9d0SAdam Hornáček</p> 221*0d40e9d0SAdam Hornáček 222*0d40e9d0SAdam Hornáček<h5>Symbol jumping</h5> 223*0d40e9d0SAdam Hornáček<p> 224*0d40e9d0SAdam 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 225*0d40e9d0SAdam 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. 226*0d40e9d0SAdam Hornáček</p> 227*0d40e9d0SAdam Hornáček 228*0d40e9d0SAdam Hornáček<h4>Diff jumper</h4> 229*0d40e9d0SAdam Hornáček 230*0d40e9d0SAdam Hornáček<p> 231*0d40e9d0SAdam 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. 232*0d40e9d0SAdam Hornáček</p> 233*0d40e9d0SAdam Hornáček<img src="<%= PageConfig.get(request).getCssDir() %>/img/diff-jumper.png"/> 234*0d40e9d0SAdam Hornáček 235*0d40e9d0SAdam Hornáček<h5>Mouse and keyboard navigation</h5> 236*0d40e9d0SAdam Hornáček<p> 237*0d40e9d0SAdam 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, 238*0d40e9d0SAdam 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. 239*0d40e9d0SAdam Hornáček</p> 240*0d40e9d0SAdam Hornáček<img src="<%= PageConfig.get(request).getCssDir() %>/img/diff-jumping.png"/> 241*0d40e9d0SAdam Hornáček 242*0d40e9d0SAdam Hornáček </div> 243*0d40e9d0SAdam Hornáček<% 244*0d40e9d0SAdam Hornáček/* ---------------------- help.jsp end --------------------- */ 245*0d40e9d0SAdam Hornáček%><%@ 246*0d40e9d0SAdam Hornáček 247*0d40e9d0SAdam Hornáčekinclude file="foot.jspf" 248*0d40e9d0SAdam Hornáček 249*0d40e9d0SAdam Hornáček%> 250