TrackStudio uses Lucene for text indexing, which provides a rich query language that can make constructing full text queries daunting. This document is derived from the Lucene document on Query Parser Syntax.
A query is broken up into terms and operators. There are two types of terms: Single Terms and Phrases. A Single Term is a single word such as "test" or "hello". A Phrase is a group of words surrounded by double quotes such as "hello dolly". Multiple terms can be combined together with Boolean operators to form a more complex query (see below). All query terms are case insensitive.
TrackStudio supports modifying query terms to provide a wide range of searching options.
TrackStudio supports single and multiple character wildcard searches. To perform a single character wildcard search use the "?" symbol. To perform a multiple character wildcard search use the "*" symbol. You cannot use a * or ? symbol as the first character of a search. The single character wildcard search looks for terms that match that with the single character replaced. For example, to search for "text" or "test" you can use the search:
te?t
Multiple character wildcard searches looks for 0 or more characters. For example, to search for Windows, Win95 or WindowsNT you can use the search:
win*
You can also use the wildcard searches in the middle of a term. For example, to search for Win95 or Windows95 you can use the search
wi*95
TrackStudio supports fuzzy searches. To do a fuzzy search use the tilde, "~", symbol at the end of a Single word Term. For example to search for a term similar in spelling to "roam" use the fuzzy search:
roam~
This search will find terms like foam and roams
Boolean operators allow terms to be combined through logic operators. TrackStudio supports AND, "+", OR, NOT and "-" as Boolean operators . Boolean operators must be ALL CAPS.
The OR operator is the default conjunction operator. This means that if there is no Boolean operator between two terms, the OR operator is used. The OR operator links two terms and finds a matching document if either of the terms exist in a document. This is equivalent to a union using sets. The symbol || can be used in place of the word OR.
To search for documents that contain either "software TrackStudio" or just "TrackStudio" use the query:
software || TrackStudio
or
software OR TrackStudio
The AND operator matches documents where both terms exist anywhere in the text of a single document. This is equivalent to an intersection using sets. The symbol && can be used in place of the word AND.
To search for documents that contain "software TrackStudio" and "issue tracking" use the query:
TrackStudio AND tracking
The "+" or required operator requires that the term after the "+" symbol exist somewhere in a the field of a single document.
To search for documents that must contain "TrackStudio" and may contain "software" use the query:
+TrackStudio software
The NOT operator excludes documents that contain the term after NOT. This is equivalent to a difference using sets. The symbol ! can be used in place of the word NOT.
To search for documents that contain "software TrackStudio" but not "japan" use the query:
TrackStudio NOT japan
Note: The NOT operator cannot be used with just one term. For example, the following search will return no results:
NOT TrackStudio
The "-" or prohibit operator excludes documents that contain the term after the "-" symbol.
To search for documents that contain "software TrackStudio" but not "japan" use the query:
TrackStudio -japan
TrackStudio supports using parentheses to group clauses to form sub queries. This can be very useful if you want to control the boolean logic for a query.
To search for either "software" or "TrackStudio" and "bugs" use the query:
(software OR TrackStudio) AND bugs
This eliminates any confusion and makes sure you that bugs must exist and either term software or TrackStudio may exist.
TrackStudio supports escaping special characters that are part of the query syntax. The current list special characters are
+ - && || ! ( ) { } [ ] ^ " ~ * ? : \
To escape these character use the \ before the character. For example to search for (1+1):2 use the query:
\(1\+1\)\:2
Copyright (c) 2002-2006. All rights reserved.
|
What do you think about this topic? Send feedback!
|