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