help.jsp revision 4fd421f78fa03a25d6771c9347f33699ae8ca20c
c0550b01024b910b8c1468811c0ea663b10b1372Trond NorbyeCDDL HEADER START
c0550b01024b910b8c1468811c0ea663b10b1372Trond NorbyeThe contents of this file are subject to the terms of the
59b6a8c0cc6ef741a7180504b3c371e67c2aa338Knut Anders HatlenCommon Development and Distribution License (the "License").
c0550b01024b910b8c1468811c0ea663b10b1372Trond NorbyeYou may not use this file except in compliance with the License.
c0550b01024b910b8c1468811c0ea663b10b1372Trond NorbyeSee LICENSE.txt included in this distribution for the specific
c0550b01024b910b8c1468811c0ea663b10b1372Trond Norbyelanguage governing permissions and limitations under the License.
c0550b01024b910b8c1468811c0ea663b10b1372Trond NorbyeWhen distributing Covered Code, include this CDDL HEADER in each
c0550b01024b910b8c1468811c0ea663b10b1372Trond Norbyefile and include the License file at LICENSE.txt.
c0550b01024b910b8c1468811c0ea663b10b1372Trond NorbyeIf applicable, add the following below this CDDL HEADER, with the
c0550b01024b910b8c1468811c0ea663b10b1372Trond Norbyefields enclosed by brackets "[]" replaced with your own identifying
c0550b01024b910b8c1468811c0ea663b10b1372Trond Norbyeinformation: Portions Copyright [yyyy] [name of copyright owner]
c0550b01024b910b8c1468811c0ea663b10b1372Trond NorbyeCDDL HEADER END
c0550b01024b910b8c1468811c0ea663b10b1372Trond NorbyeCopyright 2007 Sun Microsystems, Inc. All rights reserved.
c0550b01024b910b8c1468811c0ea663b10b1372Trond NorbyeUse is subject to license terms.
14a41f02433890d19b2f871156271e3388cd0845Jens ElknerPortions Copyright 2011 Jens Elkner.
14a41f02433890d19b2f871156271e3388cd0845Jens Elkner--%><%@ page session="false" errorPage="error.jsp" import="
14a41f02433890d19b2f871156271e3388cd0845Jens Elkner/* ---------------------- help.jsp start --------------------- */
59b6a8c0cc6ef741a7180504b3c371e67c2aa338Knut Anders Hatlen cfg.setTitle("OpenGrok Help");
59b6a8c0cc6ef741a7180504b3c371e67c2aa338Knut Anders Hatlen <div id="page">
59b6a8c0cc6ef741a7180504b3c371e67c2aa338Knut Anders Hatlen <div id="whole_header">
59b6a8c0cc6ef741a7180504b3c371e67c2aa338Knut Anders Hatlen <div id="header"><%@
59b6a8c0cc6ef741a7180504b3c371e67c2aa338Knut Anders Hatlen <div id="Masthead"></div>
59b6a8c0cc6ef741a7180504b3c371e67c2aa338Knut Anders Hatlen <div id="sbar">
59b6a8c0cc6ef741a7180504b3c371e67c2aa338Knut Anders Hatlen <div id="menu"><%@
14a41f02433890d19b2f871156271e3388cd0845Jens Elknerinclude file="menu.jspf"
59b6a8c0cc6ef741a7180504b3c371e67c2aa338Knut Anders Hatlen <div id="help">
9a4361e23046cda58b9a5b8f4e11910dc433badaLubos Kosco<dfn><b>Examples:</b></dfn>
9a4361e23046cda58b9a5b8f4e11910dc433badaLubos Kosco<pre class="example">
9a4361e23046cda58b9a5b8f4e11910dc433badaLubos KoscoTo find where setResourceMonitors is defined:
9a4361e23046cda58b9a5b8f4e11910dc433badaLubos Kosco<a href="search?q=&defs=setResourceMonitors">defs:setResourceMonitors</a>
9a4361e23046cda58b9a5b8f4e11910dc433badaLubos KoscoTo find files that use sprintf in usr/src/cmd/cmd-inet/usr.sbin/:
9a4361e23046cda58b9a5b8f4e11910dc433badaLubos Kosco<a href="search?refs=sprintf&path=usr%2Fsrc%2Fcmd%2Fcmd-inet%2Fusr.sbin%2F"
9a4361e23046cda58b9a5b8f4e11910dc433badaLubos Kosco>refs:sprintf path:usr/src/cmd/cmd-inet/usr.sbin</a>
9a4361e23046cda58b9a5b8f4e11910dc433badaLubos KoscoTo find assignments to variable foo:
9a4361e23046cda58b9a5b8f4e11910dc433badaLubos Kosco<a href="search?q=%22foo+%3D%22">"foo ="</a>
9a4361e23046cda58b9a5b8f4e11910dc433badaLubos KoscoTo find Makefiles where pstack binary is being built:
9a4361e23046cda58b9a5b8f4e11910dc433badaLubos Kosco<a href="search?q=pstack&path=Makefile">pstack path:Makefile</a>
9a4361e23046cda58b9a5b8f4e11910dc433badaLubos Koscoto search for phrase "Bill Joy":
9a4361e23046cda58b9a5b8f4e11910dc433badaLubos Kosco<a href="search?q=%22Bill+Joy%22">"Bill Joy"</a>
9a4361e23046cda58b9a5b8f4e11910dc433badaLubos KoscoTo find perl files that do not use /usr/bin/perl but something else:
9a4361e23046cda58b9a5b8f4e11910dc433badaLubos Kosco<a href="search?q=-%22%2Fusr%2Fbin%2Fperl%22+%2B%22%2Fbin%2Fperl%22"
4fd421f78fa03a25d6771c9347f33699ae8ca20cLubos KoscoTo find all strings beginning with foo use the wildcard:
9a4361e23046cda58b9a5b8f4e11910dc433badaLubos Kosco<a href="search?q=foo*">foo*</a>
99b4056e2c5b0a51f7f480ebcefb1f917613ce2aLubos KoscoTo find all files which have . c in their name (dot is a token!):
9a4361e23046cda58b9a5b8f4e11910dc433badaLubos Kosco<a href="search?path=%22. c%22">". c"</a>
9a4361e23046cda58b9a5b8f4e11910dc433badaLubos KoscoTo find all files which start with "ma" and then have only alphabet characters do:
9a4361e23046cda58b9a5b8f4e11910dc433badaLubos Kosco<a href="search?path=/ma[a-zA-Z]*/">path:/ma[a-zA-Z]*/</a>
9a4361e23046cda58b9a5b8f4e11910dc433badaLubos KoscoTo find all main methods in all files analyzed by C analyzer (so .c, .h, ...) do:
9a4361e23046cda58b9a5b8f4e11910dc433badaLubos Kosco<a href="search?q=main&type=c">main type:c</a>
9a4361e23046cda58b9a5b8f4e11910dc433badaLubos Kosco<dfn><b>More info:</b></dfn><br/><br/>
14a41f02433890d19b2f871156271e3388cd0845Jens ElknerA <dfn>Query</dfn> is a series of clauses. A clause may be prefixed by:</p>
59b6a8c0cc6ef741a7180504b3c371e67c2aa338Knut Anders Hatlen <li>a plus "<b>+</b>" or a minus "<b>-</b>" sign, indicating that the clause
59b6a8c0cc6ef741a7180504b3c371e67c2aa338Knut Anders Hatlen is required or prohibited respectively; or</li>
59b6a8c0cc6ef741a7180504b3c371e67c2aa338Knut Anders Hatlen <li>a <dfn>term</dfn> followed by a colon "<b>:</b>", indicating the
59b6a8c0cc6ef741a7180504b3c371e67c2aa338Knut Anders Hatlen <dfn>field</dfn> to be searched. This enables one to construct queries
59b6a8c0cc6ef741a7180504b3c371e67c2aa338Knut Anders Hatlen which search multiple <dfn>fields</dfn>.</li>
14a41f02433890d19b2f871156271e3388cd0845Jens Elkner<p>A clause may be either:</p>
59b6a8c0cc6ef741a7180504b3c371e67c2aa338Knut Anders Hatlen <li>a <dfn>term</dfn>, indicating all the documents that contain this term;
59b6a8c0cc6ef741a7180504b3c371e67c2aa338Knut Anders Hatlen <li>a <dfn>phrase</dfn> - group of words surrounded by double quotes
59b6a8c0cc6ef741a7180504b3c371e67c2aa338Knut Anders Hatlen <b>" "</b>, e.g. "hello dolly" </li>
59b6a8c0cc6ef741a7180504b3c371e67c2aa338Knut Anders Hatlen <li>a nested query, enclosed in parentheses "<b>(</b>" "<b>)</b>" (also
59b6a8c0cc6ef741a7180504b3c371e67c2aa338Knut Anders Hatlen called query/field <dfn>grouping</dfn>) . Note that this may be used
59b6a8c0cc6ef741a7180504b3c371e67c2aa338Knut Anders Hatlen with a +/- prefix to require any of a set of terms. </li>
59b6a8c0cc6ef741a7180504b3c371e67c2aa338Knut Anders Hatlen <li>boolean <dfn>operators</dfn> which allow terms to be combined through
59b6a8c0cc6ef741a7180504b3c371e67c2aa338Knut Anders Hatlen logic operators. Supported are <b>AND</b>(<b>&&</b>), "<b>+</b>",
59b6a8c0cc6ef741a7180504b3c371e67c2aa338Knut Anders Hatlen <b>OR</b>(<b>||</b>), <b>NOT</b>(<b>!</b>) and "<b>-</b>" (Note: they
59b6a8c0cc6ef741a7180504b3c371e67c2aa338Knut Anders Hatlen must be ALL CAPS).</li>
9c4ded641ae76132f262728f5d64e30fb004ae47Lubos Kosco<p>Regular Expression, Wildcard, Fuzzy, Proximity & Range Searches:</p>
9c4ded641ae76132f262728f5d64e30fb004ae47Lubos Kosco <li>to perform a regular expression search use the "<b>/</b>" enclosure,
60281ca3d1db22f5d2204e1be4975504853072a7Lubos Kosco e.g. /[mb]an/ - will search for man or for ban;<br>
9c4ded641ae76132f262728f5d64e30fb004ae47Lubos Kosco NOTE: path field search escapes "/" by default, so it only supports
60281ca3d1db22f5d2204e1be4975504853072a7Lubos Kosco regexps when the search string <u>starts and ends</u> with "/".<br>
4fd421f78fa03a25d6771c9347f33699ae8ca20cLubos Kosco More info can be found on <a href="http://lucene.apache.org/core/4_5_1/core/org/apache/lucene/util/automaton/RegExp.html?is-external=true">lucene regexp page</a>.
59b6a8c0cc6ef741a7180504b3c371e67c2aa338Knut Anders Hatlen <li>to perform a single character wildcard search use the "<b>?</b>" symbol,
59b6a8c0cc6ef741a7180504b3c371e67c2aa338Knut Anders Hatlen <li>to perform a multiple character wildcard search use the "<b>*</b>"
59b6a8c0cc6ef741a7180504b3c371e67c2aa338Knut Anders Hatlen symbol, e.g. test* or te*t</li>
9c4ded641ae76132f262728f5d64e30fb004ae47Lubos Kosco <li>you can use a * or ? symbol as the first character of a search
9c4ded641ae76132f262728f5d64e30fb004ae47Lubos Kosco (unless not enabled using indexer option -a).</li>
99b4056e2c5b0a51f7f480ebcefb1f917613ce2aLubos Kosco <li>to do a fuzzy search (find words similar in spelling, based on the
59b6a8c0cc6ef741a7180504b3c371e67c2aa338Knut Anders Hatlen Levenshtein Distance, or Edit Distance algorithm) use the tilde,
59b6a8c0cc6ef741a7180504b3c371e67c2aa338Knut Anders Hatlen "<b>~</b>", e.g. rcs~ </li>
59b6a8c0cc6ef741a7180504b3c371e67c2aa338Knut Anders Hatlen <li>to do a proximity search use the tilde, "~", symbol at the end of a
59b6a8c0cc6ef741a7180504b3c371e67c2aa338Knut Anders Hatlen Phrase. For example to search for a "opengrok" and "help" within 10
59b6a8c0cc6ef741a7180504b3c371e67c2aa338Knut Anders Hatlen words of each other enter: "opengrok help"~10 </li>
59b6a8c0cc6ef741a7180504b3c371e67c2aa338Knut Anders Hatlen <li>range queries allow one to match documents whose field(s) values are
59b6a8c0cc6ef741a7180504b3c371e67c2aa338Knut Anders Hatlen between the lower and upper bound specified by the Range Query. Range
59b6a8c0cc6ef741a7180504b3c371e67c2aa338Knut Anders Hatlen Queries can be inclusive or exclusive of the upper and lower bounds.
59b6a8c0cc6ef741a7180504b3c371e67c2aa338Knut Anders Hatlen Sorting is done lexicographically. Inclusive queries are denoted by
59b6a8c0cc6ef741a7180504b3c371e67c2aa338Knut Anders Hatlen square brackets <b>[ ]</b> , exclusive by curly brackets <b>{ }</b>.
59b6a8c0cc6ef741a7180504b3c371e67c2aa338Knut Anders Hatlen For example: title:{Aida TO Carmen} - will find all documents between
59b6a8c0cc6ef741a7180504b3c371e67c2aa338Knut Anders Hatlen Aida to Carmen, exclusive of Aida and Carmen. </li>
14a41f02433890d19b2f871156271e3388cd0845Jens Elkner<a id="escaping"><dfn>Escaping special characters:</dfn></a>
59b6a8c0cc6ef741a7180504b3c371e67c2aa338Knut Anders Hatlen<p>Opengrok supports escaping special characters that are part of the query
59b6a8c0cc6ef741a7180504b3c371e67c2aa338Knut Anders Hatlen syntax. Current special characters are:<br/>
9c4ded641ae76132f262728f5d64e30fb004ae47Lubos Kosco <b>+ - && || ! ( ) { } [ ] ^ " ~ * ? : \ / </b><br/>
59b6a8c0cc6ef741a7180504b3c371e67c2aa338Knut Anders HatlenTo escape these character use the \ before the character. For example to search
14a41f02433890d19b2f871156271e3388cd0845Jens Elknerfor <b>(1+1):2</b> use the query: <b>\(1\+1\)\:2</b>
59b6a8c0cc6ef741a7180504b3c371e67c2aa338Knut Anders Hatlen<p>NOTE on analyzers: Indexed words are made up of Alpha-Numeric and Underscore
14a41f02433890d19b2f871156271e3388cd0845Jens Elknercharacters. One letter words are usually not indexed as symbols!<br/>
99b4056e2c5b0a51f7f480ebcefb1f917613ce2aLubos KoscoMost other characters (including single and double quotes) are treated as
99b4056e2c5b0a51f7f480ebcefb1f917613ce2aLubos Kosco"spaces/whitespace" (so even if you escape them, they will not be found, since
14a41f02433890d19b2f871156271e3388cd0845Jens Elknermost analyzers ignore them). <br/>
59b6a8c0cc6ef741a7180504b3c371e67c2aa338Knut Anders HatlenThe exceptions are: <b>@ $ % ^ & = ? . :</b> which are mostly indexed as
14a41f02433890d19b2f871156271e3388cd0845Jens Elknerseparate words.<br/>
59b6a8c0cc6ef741a7180504b3c371e67c2aa338Knut Anders HatlenBecause some of them are part of the query syntax, they must be escaped with a
14a41f02433890d19b2f871156271e3388cd0845Jens Elknerreverse slash as noted above.<br/>
e655c7911217c7948ee6d9eb73bff3a712b0fa70Lubos KoscoSo searching for <b>\+1</b> or <b>\+ 1</b> will both find <b>+1</b> and <b>+ 1</b>.
14a41f02433890d19b2f871156271e3388cd0845Jens Elkner<p>valid <dfn>FIELDs</dfn> are</p>
59b6a8c0cc6ef741a7180504b3c371e67c2aa338Knut Anders Hatlen <dl class="fields">
14a41f02433890d19b2f871156271e3388cd0845Jens Elkner<dt>full</dt>
99b4056e2c5b0a51f7f480ebcefb1f917613ce2aLubos Kosco<dd>Search through all text tokens (words,strings,identifiers,numbers) in index.</dd>
14a41f02433890d19b2f871156271e3388cd0845Jens Elkner<dt>defs</dt>
99b4056e2c5b0a51f7f480ebcefb1f917613ce2aLubos Kosco<dd>Only finds symbol definitions (where e.g. a variable (function, ...) is defined).</dd>
14a41f02433890d19b2f871156271e3388cd0845Jens Elkner<dt>refs</dt>
99b4056e2c5b0a51f7f480ebcefb1f917613ce2aLubos Kosco<dd>Only finds symbols (e.g. methods, classes, functions, variables).</dd>
14a41f02433890d19b2f871156271e3388cd0845Jens Elkner<dt>path</dt>
1cd6ad07549a4d391f20e9ed7aa8723bef6a91bbLubos Kosco<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>
14a41f02433890d19b2f871156271e3388cd0845Jens Elkner<dt>hist</dt>
14a41f02433890d19b2f871156271e3388cd0845Jens Elkner<dd>History log comments.</dd>
9a4361e23046cda58b9a5b8f4e11910dc433badaLubos Kosco<dt>type</dt>
99b4056e2c5b0a51f7f480ebcefb1f917613ce2aLubos Kosco<dd>Type of analyzer used to scope down to certain file types (e.g. just C sources).<br/>Current mappings: <%=SearchHelper.getFileTypeDescirptions().toString()%></dd>
99b4056e2c5b0a51f7f480ebcefb1f917613ce2aLubos Koscothe term (phrases) can be boosted (making it more relevant) using a caret
14a41f02433890d19b2f871156271e3388cd0845Jens Elkner<b>^</b> , e.g. help^4 opengrok - will make term help boosted
14a41f02433890d19b2f871156271e3388cd0845Jens Elkner<p>Opengrok search is powered by <a href="http://lucene.apache.org/"
4fd421f78fa03a25d6771c9347f33699ae8ca20cLubos Kosco>lucene</a>, for more detail on query syntax refer to <a href="http://lucene.apache.org/core/4_5_1/queryparser/org/apache/lucene/queryparser/classic/package-summary.html#package_description">lucene docs</a>.<br>
14a41f02433890d19b2f871156271e3388cd0845Jens Elkner/* ---------------------- help.jsp end --------------------- */
14a41f02433890d19b2f871156271e3388cd0845Jens Elknerinclude file="foot.jspf"