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/Alanguage governing permissions and limitations under the License.
565N/AWhen distributing Covered Code, include this CDDL HEADER in each
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/ACopyright 2007 Sun Microsystems, Inc. All rights reserved.
565N/AUse is subject to license terms.
996N/APortions Copyright 2011 Jens Elkner.
565N/A/* ----------------------
help.jsp start --------------------- */
565N/A <div id="whole_header">
941N/A <div id="Masthead"></div>
926N/A<dfn><b>Examples:</b></dfn>
565N/ATo find where setResourceMonitors is defined:
565N/A<a href="search?q=&defs=setResourceMonitors">defs:setResourceMonitors</a>
565N/A<a href="search?refs=sprintf&path=usr%2Fsrc%2Fcmd%2Fcmd-inet%
2Fusr.sbin%2F"
565N/ATo find assignments to variable foo:
565N/A<a href="search?q=%22foo+%3D%22">"foo ="</a>
565N/ATo find Makefiles where pstack binary is being built:
565N/A<a href="search?q=pstack&path=Makefile">pstack path:Makefile</a>
565N/Ato search for phrase "Bill Joy":
565N/A<a href="search?q=%22Bill+Joy%22">"Bill Joy"</a>
565N/A<a href="search?q=-%22%2Fusr%2Fbin%2Fperl%22+%2B%22%2Fbin%2Fperl%22"
696N/ATo find all strings beginning with foo use the wildcard:
565N/A<a href="search?q=foo*">foo*</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/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/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<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 <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<p>A clause may be either:</p>
565N/A <li>a <dfn>term</dfn>, indicating all the documents that contain this term;
565N/A <li>a <dfn>phrase</dfn> - group of words surrounded by double quotes
565N/A <li>a nested query, enclosed in parentheses "<b>(</b>" "<b>)</b>" (also
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>&&</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<p>Regular Expression, Wildcard, Fuzzy, Proximity & Range Searches:</p>
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>
1080N/A <li>to perform a single character wildcard search use the "<b>?</b>" symbol,
565N/A <li>to perform a multiple character wildcard search use the "<b>*</b>"
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 <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<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>+ - && || ! ( ) { } [ ] ^ " ~ * ? : \ / </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>
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/Amost analyzers ignore them). <br/>
926N/AThe exceptions are: <b>@ $ % ^ & = ? . :</b> which are mostly indexed as
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>.
1102N/A<p>valid <dfn>FIELDs</dfn> are</p>
1102N/A<dd>Search through all text tokens (words,strings,identifiers,numbers) in index.</dd>
1102N/A<dd>Only finds symbol definitions (where
e.g. a variable (function, ...) is defined).</dd>
565N/A<dd>Only finds symbols (
e.g. methods, classes, functions, variables).</dd>
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<dd>History log comments.</dd>
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