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