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