TeamForge full-text search guidelines

Here is some guidelines to help you create effective searches.

Single term, multiple terms and phrase

Single-term search looks for all search results that match the search text. For example, a search entry of doc only returns search results of "doc".

Multiple-terms search looks for all search results that match any of the words in the search text. For example, a search entry of document plan returns search results of "document", "plan", and "document plan".

A group of words surrounded by double quotes, such as "product requirements", return only search results containing the entire phrase.

Boolean operators

Terms and phrases can be combined with Boolean operators for more complex searches. Boolean operators must be in upper case. Use:
  • OR between two terms returns search results containing either of the terms. This is the default operator used if no other operator is specified.
  • AND between two terms returns only search results containing both of the terms.
  • The + operator before a term makes the term required. Only search results containing the terms are returned.
  • The - or NOT operator before a term returns only search results that do not contain the term. The character "-" represents the Boolean operator AND NOT.
Tip:

You can group Boolean searches using parentheses. For example, (doc OR test) AND plan returns search results containing "doc plan" and "test plan".

Wildcard searches

To look for search results with a single character replaced, use the ? symbol. For example, to look for search results with "text" or "test", enter te?t.

To look for search results with more than one character replaced, use the * symbol. For example, to look for search results such as "content" or "contest" or "continuous" or "control", enter cont*.

Note:

You can use wildcard symbols in the middle or at the end of a search, but not as the first character of a search keyword.

Fuzzy searches

To look for search results with spelling similar to the search term entered, use the ~ symbol as the last character of the search keyword. For example, to look for search results with spelling similar to "roam", enter roam~. This returns search results such as "roam" and "roams".

Special characters

If you have any of the following special characters in your search text, you must escape them by enclosing the entire phrase in double quotes. + - & || ! ( ) { } [ ] ^ " ~ * ? : \

For example, to look for search results containing the hyphenated term "product-development", enter product-development.

The special character "+" represents the Boolean operator AND. The special character "-" represents the Boolean operator AND NOT.

Regular expression search with forward slashes

Lucene 4 supports regular expression searches matching a pattern between forward slashes "/". For example, to look for search results containing the words "moat" or "boat", use the search string /[mb]oat/.

If you are specifically looking for search results containing a forward slash "/" character, you must backslash-escape or quote-escape the forward slash character. For example, to look for search results containing "<opt/collabnet>", use the search string <opt\/collabnet>.

Excluded words

The following words are considered stop words and are not search-able on their own: a, an, and, are, as, at, be, but, by, for, if, in, into, is, it, no, not, of, on, or, s, such, that, the, their, then, there, these, they, this, to, was, will, with

Range searches

You can do a range-bound search using the TO operator. For example, the search entry, [artf1100 TO artf1200], returns items containing values between artf1100 and artf1200, including artf1100 and artf1200. To exclude the upper and lower bounds from the search results, use curly brackets {} instead of square brackets [].