help.jsp revision be129181c479d0994742681b1513b15c4ff2d1e2
31d3464c0c0a35236c7924f698c5a8a66a9ed534Mark AndrewsCDDL HEADER START
2f6d1483f665d86501049199b9698554da0eacb0Mark AndrewsThe contents of this file are subject to the terms of the
2f6d1483f665d86501049199b9698554da0eacb0Mark AndrewsCommon Development and Distribution License (the "License").
2f6d1483f665d86501049199b9698554da0eacb0Mark AndrewsYou may not use this file except in compliance with the License.
ea7b38cd1e5c6c9e099f1b3a702ba531bc4aba0aMark AndrewsSee LICENSE.txt included in this distribution for the specific
32d248107a5bc92b4bf9fc77deaa55b3da969ba2Andreas Gustafssonlanguage governing permissions and limitations under the License.
32d248107a5bc92b4bf9fc77deaa55b3da969ba2Andreas GustafssonWhen distributing Covered Code, include this CDDL HEADER in each
32d248107a5bc92b4bf9fc77deaa55b3da969ba2Andreas Gustafssonfile and include the License file at LICENSE.txt.
4574714ad44ba97f53425fe8d21b7ecb00ac83b9Andreas GustafssonIf applicable, add the following below this CDDL HEADER, with the
4574714ad44ba97f53425fe8d21b7ecb00ac83b9Andreas Gustafssonfields enclosed by brackets "[]" replaced with your own identifying
4574714ad44ba97f53425fe8d21b7ecb00ac83b9Andreas Gustafssoninformation: Portions Copyright [yyyy] [name of copyright owner]
4574714ad44ba97f53425fe8d21b7ecb00ac83b9Andreas GustafssonCDDL HEADER END
8d8c145175370d2fd8dbdf425b5ac2a9dc19da96Mark AndrewsCopyright 2007 Sun Microsystems, Inc. All rights reserved.
07eaf0b8d0c3c93d8139c413bf9cc8bba7db9432Mark AndrewsUse is subject to license terms.
cf70df7d0e24401a358f0b9c1a616ad0e8c783a6Mark AndrewsPortions Copyright 2011 Jens Elkner.
9234d92d4e274791eff42cc4ea5766ed7a281b17Mark Andrews--%><%@ page session="false" errorPage="error.jsp" import="
0cf9ce19cc05a60f85ec610106a983fe806ebb77Andreas Gustafsson/* ---------------------- help.jsp start --------------------- */
0cf9ce19cc05a60f85ec610106a983fe806ebb77Andreas Gustafsson cfg.setTitle("OpenGrok Help");
3c3fe072252aecffae43e6349125663c315b092dAndreas Gustafsson <div id="page">
64ea5fd972c9946a3fe56cbc0bf897266d3f8747Andreas Gustafsson <div id="whole_header">
64ea5fd972c9946a3fe56cbc0bf897266d3f8747Andreas Gustafsson <div id="header"><%@
1094dec52a86e57df53f6167d86de94360a7a382Mark Andrews <div id="Masthead"></div>
64ea5fd972c9946a3fe56cbc0bf897266d3f8747Andreas Gustafsson <div id="sbar">
1094dec52a86e57df53f6167d86de94360a7a382Mark Andrews <div id="menu"><%@
62a3dbe63e833f2eaf613393399ea4667d8de28dAndreas Gustafsson <div id="help">
62a3dbe63e833f2eaf613393399ea4667d8de28dAndreas Gustafsson<dfn><b>Examples:</b></dfn>
248732d66fffb557e84264c2bb2fb43ac766163fAndreas Gustafsson<pre class="example">
9bdb01e6c382e897572791b12190472955994d87Mark AndrewsTo find where setResourceMonitors is defined:
e69b9ffb0f8b4d1117a682908c9143ebe3efcd6bAndreas Gustafsson<a href="search?q=&defs=setResourceMonitors">defs:setResourceMonitors</a>
e69b9ffb0f8b4d1117a682908c9143ebe3efcd6bAndreas GustafssonTo find files that use sprintf in usr/src/cmd/cmd-inet/usr.sbin/:
417872b98aec720d587a9ef0197e25e78a2b7ee9Mark Andrews<a href="search?refs=sprintf&path=usr%2Fsrc%2Fcmd%2Fcmd-inet%2Fusr.sbin%2F"
417872b98aec720d587a9ef0197e25e78a2b7ee9Mark Andrews>refs:sprintf path:usr/src/cmd/cmd-inet/usr.sbin</a>
a77ad145d0109081c5da6ac40a2303369db89735Andreas GustafssonTo find assignments to variable foo:
8ba4e82f5358815fd94f34fde408ffd047ba3430Andreas Gustafsson<a href="search?q=%22foo+%3D%22">"foo ="</a>
61d5bfc06be978ea962b1c64309894ac80351771Mark AndrewsTo find Makefiles where pstack binary is being built:
ada9b8ab20b81716c7ff1f4f3365929b2f7c8ff8Mark Andrews<a href="search?q=pstack&path=Makefile">pstack path:Makefile</a>
ada9b8ab20b81716c7ff1f4f3365929b2f7c8ff8Mark Andrewsto search for phrase "Bill Joy":
3c9b2e62502460c34c2e0ceba1a5d138b3a13cc1Andreas Gustafsson<a href="search?q=%22Bill+Joy%22">"Bill Joy"</a>
3c9b2e62502460c34c2e0ceba1a5d138b3a13cc1Andreas GustafssonTo find perl files that do not use /usr/bin/perl but something else:
1beaa9e45738ad18cb7cae55aea95a1b16a14f94Andreas Gustafsson<a href="search?q=-%22%2Fusr%2Fbin%2Fperl%22+%2B%22%2Fbin%2Fperl%22"
bb60abb44549428414cd55a022f2b8cc4488f7adAndreas GustafssonTo find all strings begining with foo use the wildcard:
bb60abb44549428414cd55a022f2b8cc4488f7adAndreas Gustafsson<a href="search?q=foo*">foo*</a>
024face21cdfbfc7a862a3be061e6780533ef755Andreas GustafssonTo find all files which have . c in their name (dot is a token!):
024face21cdfbfc7a862a3be061e6780533ef755Andreas Gustafsson<a href="search?path=%22. c%22">". c"</a>
1beaa9e45738ad18cb7cae55aea95a1b16a14f94Andreas GustafssonTo find all files which start with "ma" and then have only alphabet characters do:
1beaa9e45738ad18cb7cae55aea95a1b16a14f94Andreas Gustafsson<a href="search?path=/ma[a-zA-Z]*/">path:/ma[a-zA-Z]*/</a>
f953788d75c7df2db43907c68da18ed75c235dd3Andreas GustafssonTo find all main methods in all files analyzed by C analyzer (so .c, .h, ...) do:
f953788d75c7df2db43907c68da18ed75c235dd3Andreas Gustafsson<a href="search?q=main&type=c">main type:c</a>
fbdde79262a4ba2bdf4bfae61167026b3220488aAndreas Gustafsson<dfn><b>More info:</b></dfn><br/><br/>
4fa5d53e750b4e34e19b9648900d489315b185eaAndreas GustafssonA <dfn>Query</dfn> is a series of clauses. A clause may be prefixed by:</p>
fbdde79262a4ba2bdf4bfae61167026b3220488aAndreas Gustafsson <li>a plus "<b>+</b>" or a minus "<b>-</b>" sign, indicating that the clause
fbdde79262a4ba2bdf4bfae61167026b3220488aAndreas Gustafsson is required or prohibited respectively; or</li>
a7e1dcd84ada7e4e4c78f3f281e8a4d99adaf4d1Andreas Gustafsson <li>a <dfn>term</dfn> followed by a colon "<b>:</b>", indicating the
a7e1dcd84ada7e4e4c78f3f281e8a4d99adaf4d1Andreas Gustafsson <dfn>field</dfn> to be searched. This enables one to construct queries
a7e1dcd84ada7e4e4c78f3f281e8a4d99adaf4d1Andreas Gustafsson which search multiple <dfn>fields</dfn>.</li>
3fc4c1434d7ac377c720640e2e925a3af567cccbMark Andrews<p>A clause may be either:</p>
2975d0f819762614526c650b9c2077ef22f81328Andreas Gustafsson <li>a <dfn>term</dfn>, indicating all the documents that contain this term;
0bd2ea544e95601e0f0b056acfa079c99d5f6b57Andreas Gustafsson <li>a <dfn>phrase</dfn> - group of words surrounded by double quotes
0bd2ea544e95601e0f0b056acfa079c99d5f6b57Andreas Gustafsson <b>" "</b>, e.g. "hello dolly" </li>
0bd2ea544e95601e0f0b056acfa079c99d5f6b57Andreas Gustafsson <li>a nested query, enclosed in parentheses "<b>(</b>" "<b>)</b>" (also
5f7516bee5ace9542701f23fc7723a3e3196802aMark Andrews called query/field <dfn>grouping</dfn>) . Note that this may be used
79432444e84d2d104119fe6a3d5cbc04b1375bd4Andreas Gustafsson with a +/- prefix to require any of a set of terms. </li>
79432444e84d2d104119fe6a3d5cbc04b1375bd4Andreas Gustafsson <li>boolean <dfn>operators</dfn> which allow terms to be combined through
2e24e82fc3551e3228bcacaa7c45cb61daa49195Mark Andrews logic operators. Supported are <b>AND</b>(<b>&&</b>), "<b>+</b>",
3c17010ba5a6b8dd8a2bbc550813c7f051f45a08Andreas Gustafsson <b>OR</b>(<b>||</b>), <b>NOT</b>(<b>!</b>) and "<b>-</b>" (Note: they
3c17010ba5a6b8dd8a2bbc550813c7f051f45a08Andreas Gustafsson must be ALL CAPS).</li>
d5169236b7260d447e672db8256fdd7c70f5ee1dMark Andrews<p>Regular Expression, Wildcard, Fuzzy, Proximity & Range Searches:</p>
df7596a03eea7f1c2df89bd63d3bd4b73f274565Mark Andrews <li>to perform a regular expression search use the "<b>/</b>" enclosure,
df7596a03eea7f1c2df89bd63d3bd4b73f274565Mark Andrews e.g. /[mb]an/ - will search for man or for ban;<br>
df7596a03eea7f1c2df89bd63d3bd4b73f274565Mark Andrews NOTE: path field search escapes "/" by default, so it only supports
f08782f0923d11227983a352c26301cf703383cfMark Andrews regexps when the search string <u>starts and ends</u> with "/".<br>
f08782f0923d11227983a352c26301cf703383cfMark Andrews More info can be found on <a href="http://lucene.apache.org/core/4_5_0/core/org/apache/lucene/util/automaton/RegExp.html?is-external=true">lucene regexp page</a>.
ed2cefaf0ea367ee408cb7f6a54a413814240fa7Andreas Gustafsson <li>to perform a single character wildcard search use the "<b>?</b>" symbol,
ed2cefaf0ea367ee408cb7f6a54a413814240fa7Andreas Gustafsson <li>to perform a multiple character wildcard search use the "<b>*</b>"
ed2cefaf0ea367ee408cb7f6a54a413814240fa7Andreas Gustafsson symbol, e.g. test* or te*t</li>
b923e278535b4e8d264998a85a6ae1eb4b3aa4c6Andreas Gustafsson <li>you can use a * or ? symbol as the first character of a search
b923e278535b4e8d264998a85a6ae1eb4b3aa4c6Andreas Gustafsson (unless not enabled using indexer option -a).</li>
b923e278535b4e8d264998a85a6ae1eb4b3aa4c6Andreas Gustafsson <li>to do a fuzzy search (find words similar in spelling, based on the
b923e278535b4e8d264998a85a6ae1eb4b3aa4c6Andreas Gustafsson Levenshtein Distance, or Edit Distance algorithm) use the tilde,
edf97be2b54cbdc4f3f3a46776df3e912892e960Andreas Gustafsson "<b>~</b>", e.g. rcs~ </li>
edf97be2b54cbdc4f3f3a46776df3e912892e960Andreas Gustafsson <li>to do a proximity search use the tilde, "~", symbol at the end of a
769ef0b7bdc9520dd62d2f440ea36bc020e88934Andreas Gustafsson Phrase. For example to search for a "opengrok" and "help" within 10
9e46f410e716f73abb345be215ccb4c61782b718Andreas Gustafsson words of each other enter: "opengrok help"~10 </li>
9e46f410e716f73abb345be215ccb4c61782b718Andreas Gustafsson <li>range queries allow one to match documents whose field(s) values are
9e46f410e716f73abb345be215ccb4c61782b718Andreas Gustafsson between the lower and upper bound specified by the Range Query. Range
769ef0b7bdc9520dd62d2f440ea36bc020e88934Andreas Gustafsson Queries can be inclusive or exclusive of the upper and lower bounds.
769ef0b7bdc9520dd62d2f440ea36bc020e88934Andreas Gustafsson Sorting is done lexicographically. Inclusive queries are denoted by
b09f4e054cbe67b93a5ff62d511ee25945038943Mark Andrews square brackets <b>[ ]</b> , exclusive by curly brackets <b>{ }</b>.
5419c0c2d0b77682021084c69f2a5c5e2f9a5525Andreas Gustafsson For example: title:{Aida TO Carmen} - will find all documents between
b09f4e054cbe67b93a5ff62d511ee25945038943Mark Andrews Aida to Carmen, exclusive of Aida and Carmen. </li>
3d3445447225ab63f49fc24362963ea49ce94901Andreas Gustafsson<a id="escaping"><dfn>Escaping special characters:</dfn></a>
40dd9cb8cc240c33d820fe79f176ed51e4c06a1aMark Andrews<p>Opengrok supports escaping special characters that are part of the query
96ea98af241ef00395f4e61de7e2dacfd9941afcMark Andrews syntax. Current special characters are:<br/>
96ea98af241ef00395f4e61de7e2dacfd9941afcMark Andrews <b>+ - && || ! ( ) { } [ ] ^ " ~ * ? : \ / </b><br/>
3dff229f5dd223568476acec4df1f513acb00b1dAndreas GustafssonTo escape these character use the \ before the character. For example to search
3dff229f5dd223568476acec4df1f513acb00b1dAndreas Gustafssonfor <b>(1+1):2</b> use the query: <b>\(1\+1\)\:2</b>
792de65053d8a48d05746b35a21a9fa1792e71acAndreas Gustafsson<p>NOTE on analyzers: Indexed words are made up of Alpha-Numeric and Underscore
792de65053d8a48d05746b35a21a9fa1792e71acAndreas Gustafssoncharacters. One letter words are usually not indexed as symbols!<br/>
792de65053d8a48d05746b35a21a9fa1792e71acAndreas GustafssonMost other characters (including single and double quotes) are treated as
808b909f27c30d36b27efb5aa5ef2d18f83b6d4bAndreas Gustafsson"spaces/whitespace" (so even if you escape them, they will not be found, since
846474d5a6aa21cebb3e94243a11faa5c20200bfAndreas Gustafssonmost analyzers ignore them). <br/>
3e934267660cb13029bcdbddf318fe1cc27b6718Andreas GustafssonThe exceptions are: <b>@ $ % ^ & = ? . :</b> which are mostly indexed as
3e934267660cb13029bcdbddf318fe1cc27b6718Andreas Gustafssonseparate words.<br/>
846474d5a6aa21cebb3e94243a11faa5c20200bfAndreas GustafssonBecause some of them are part of the query syntax, they must be escaped with a
7655e78c366cc0d25e24e2a96ba58e04a96042faAndreas Gustafssonreverse slash as noted above.<br/>
7655e78c366cc0d25e24e2a96ba58e04a96042faAndreas GustafssonSo searching for <b>\+1</b> or <b>\+ 1</b> will both find <b>+1</b> and <b>+ 1</b>.
6859033d425170380bcfac4809257bc6e9b60383Andreas Gustafsson<p>valid <dfn>FIELDs</dfn> are</p>
6859033d425170380bcfac4809257bc6e9b60383Andreas Gustafsson <dl class="fields">
5419c0c2d0b77682021084c69f2a5c5e2f9a5525Andreas Gustafsson<dd>Search through all text tokens (words,strings,identifiers,numbers) in index.</dd>
ff4322d44f8404683b6fb6c86a38a2bc14f6c083Andreas Gustafsson<dd>Only finds symbol definitions (where e.g. a variable (function, ...) is defined).</dd>
8d146b6e1156f5b562af9a4a9aba76b09650412cAndreas Gustafsson<dd>Only finds symbols (e.g. methods, classes, functions, variables).</dd>
808b909f27c30d36b27efb5aa5ef2d18f83b6d4bAndreas Gustafsson<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! Please don't use "\", or replace it with "/".).</dd>
595a14576ea14884c35b3726f054f2065365620bMark Andrews<dd>History log comments.</dd>
595a14576ea14884c35b3726f054f2065365620bMark Andrews<dt>type</dt>
640923da589bc5b8492ac407ef89ea1ee9a1c358Andreas Gustafsson<dd>Type of analyzer used to scope down to certain file types (e.g. just C sources).<br/>Current mappings: <%=SearchHelper.getFileTypeDescirptions().toString()%></dd>
640923da589bc5b8492ac407ef89ea1ee9a1c358Andreas Gustafssonthe term (phrases) can be boosted (making it more relevant) using a caret
640923da589bc5b8492ac407ef89ea1ee9a1c358Andreas Gustafsson<b>^</b> , e.g. help^4 opengrok - will make term help boosted
1299e93989afbe1fee0739811b05fd1641ea14aeAndreas Gustafsson<p>Opengrok search is powered by <a href="http://lucene.apache.org/"
0bd1b2fbfed4aa489e9d5fcbc7f48acb96ba7248Mark Andrews>lucene</a>, for more detail on query syntax refer to <a href="http://lucene.apache.org/core/4_5_0/queryparser/org/apache/lucene/queryparser/classic/package-summary.html#package_description">lucene docs</a>.<br>
01446841be2b73f9a2ead74056df2d5342414041Andreas Gustafsson/* ---------------------- help.jsp end --------------------- */