58N/AThe contents of this file are subject to the terms of the
1281N/ACommon Development and Distribution License (the "License").
58N/AYou may not use this file except in compliance with the License.
58N/Alanguage governing permissions and limitations under the License.
58N/AWhen distributing Covered Code, include this CDDL HEADER in each
58N/AIf applicable, add the following below this CDDL HEADER, with the
58N/Afields enclosed by brackets "[]" replaced with your own identifying
58N/Ainformation: Portions Copyright [yyyy] [name of copyright owner]
58N/ACopyright 2007 Sun Microsystems, Inc. All rights reserved.
58N/AUse is subject to license terms.
1186N/APortions Copyright 2011 Jens Elkner.
1281N/AA <dfn>Query</dfn> is a series of clauses. A clause may be prefixed by:</p>
1281N/A <li>a plus "<b>+</b>" or a minus "<b>-</b>" sign, indicating that the clause
1186N/A is required or prohibited respectively; or</li>
1186N/A <li>a <dfn>term</dfn> followed by a colon "<b>:</b>", indicating the
1186N/A <dfn>field</dfn> to be searched. This enables one to construct queries
1281N/A which search multiple <dfn>fields</dfn>.</li>
1186N/A<p>A clause may be either:</p>
1186N/A <li>a <dfn>term</dfn>, indicating all the documents that contain this term;
1186N/A <li>a <dfn>phrase</dfn> - group of words surrounded by double quotes
1186N/A <li>a nested query, enclosed in parentheses "<b>(</b>" "<b>)</b>" (also
called
query/field <dfn>grouping</dfn>) . Note that this may be used
with a +/- prefix to require any of a set of terms. </li>
<li>boolean <dfn>operators</dfn> which allow terms to be combined through
logic operators. Supported are <b>AND</b>(<b>&&</b>), "<b>+</b>",
<b>OR</b>(<b>||</b>), <b>NOT</b>(<b>!</b>) and "<b>-</b>" (Note: they
<p>Wildcard, Fuzzy, Proximity & Range Searches:</p>
<li>to perform a single character wildcard search use the "<b>?</b>" symbol,
<li>to perform a multiple character wildcard search use the "<b>*</b>"
symbol,
e.g. test* or te*t</li>
<li>you cannot use a * or ? symbol as the first character of a search
(unless enabled using indexer option -a).</li>
<li>to do a fuzzy search(find words similar in spelling, based on the
Levenshtein Distance, or Edit Distance algorithm) use the tilde,
"<b>~</b>",
e.g. rcs~ </li>
<li>to do a proximity search use the tilde, "~", symbol at the end of a
Phrase. For example to search for a "opengrok" and "help" within 10
words of each other enter: "opengrok help"~10 </li>
<li>range queries allow one to match documents whose field(s) values are
between the lower and upper bound specified by the Range Query. Range
Queries can be inclusive or exclusive of the upper and lower bounds.
Sorting is done lexicographically. Inclusive queries are denoted by
square brackets <b>[ ]</b> , exclusive by curly brackets <b>{ }</b>.
For example: title:{Aida TO Carmen} - will find all documents between
Aida to Carmen, exclusive of Aida and Carmen. </li>
<a id="escaping"><dfn>Escaping special characters:</dfn></a>
<p>Opengrok supports escaping special characters that are part of the query
syntax. Current special characters are:<br/>
<b>+ - && || ! ( ) { } [ ] ^ " ~ * ? : \ </b><br/>
To escape these character use the \ before the character. For example to search
for <b>(1+1):2</b> use the query: <b>\(1\+1\)\:2</b>
<p>NOTE on analyzers: Indexed words are made up of Alpha-Numeric and Underscore
characters. One letter words are usually not indexed as symbols!<br/>
Most other characters(including single and double quotes) are treated as
most analyzers ignore them). <br/>
The exceptions are: <b>@ $ % ^ & = ? . :</b> which are mostly indexed as
Because some of them are part of the query syntax, they must be escaped with a
reverse slash as noted above.<br/>
So searching for <b>\+1</b> or <b>\+ 1</b> will both find <b>+1</b> and <b>+ 1</b>.
<p>valid <dfn>FIELDs</dfn> are</p>
<dd>Search through all text tokens(words,strings,identifiers,numbers) in index.</dd>
<dd>Only finds symbol definitions.</dd>
<dd>Only finds symbols.</dd>
<dd>path of the source file.</dd>
<dd>History log comments.</dd>
the term(phrases) can be boosted (making it more relevant) using a caret
<b>^</b> ,
e.g. help^4 opengrok - will make term help boosted
<dfn><b>Examples:</b></dfn>
To find where setResourceMonitors is defined: <a
href="search?q=&defs=setResourceMonitors">defs:setResourceMonitors</a>
<a href="search?refs=sprintf&path=usr%2Fsrc%2Fcmd%2Fcmd-inet%
2Fusr.sbin%2F"
To find assignments to variable Asign:
<a href="search?q=%22asign+%3D+%22">"Asign="</a>
To find Makefiles where pstack binary is being built:
<a href="search?q=pstack&path=Makefile">pstack path:Makefile</a>
to search for phrase "Bill Joy":
<a href="search?q=%22Bill+Joy%22">"Bill Joy"</a>
To find perl files that do not use
/usr/bin/perl but something else:
<a href="search?q=-%22%2Fusr%2Fbin%2Fperl%22+%2B%22%2Fbin%2Fperl%22"
To find all strings begining with foo use the wildcard:
<a href="search?q=foo*">foo*</a>
To find all files which have . c in their name(dot is a token!):
<a href="search?path=%22. c%22">". c"</a>
>lucene</a>, for more detail on query syntax refer to lucene docs.</p>
/* ----------------------
help.jsp end --------------------- */