NSIS Users Manual Search Syntax

NSIS Users Manual search is implemented using the Lucene search engine. Described below are some of the techniques which can be used for more flexible and powerful searches.

Terms

A query is broken up into terms and operators. There are two types of terms: Single Terms and Phrases.

Term Modifiers

Query terms can be modified to provide a wide range of searching options.

Wildcard Searches

Single and multiple character wildcard searches are supported.

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

The multiple character wildcard search looks for 0 or more characters. For example, to search for "test", "tests" or "tester", you can use the search:

test*

You can also use the wildcard searches in the middle of a term.

te*t

Note: You cannot use a * or ? symbol as the first character of a search.

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 "get" use the fuzzy search:

get~

This search will find terms like "set" and "gets".

Proximity Searches

Finding words which are a within a specific distance away from each other is supported. To do a proximity search use the tilde, "~", symbol at the end of a Phrase. For example to search for a "fixed" and "posix" within 10 words of each other in a document use the search:

"fixed posix"~10

Boolean operators

Boolean operators allow terms to be combined through logic operators. AND, "+", OR, NOT and "-" Boolean operators are supported.

(Note: Boolean operators must be ALL CAPS).

OR

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 "section group" or just "section" use the query:

"section group" section

or

"section group" OR section

AND

The AND operator matches documents where both terms exist anywhere in the text of a single document. The symbol && can be used in place of the word AND.

To search for documents that contain "section group " and "uninstall section" use the query:

"section group" AND "uninstall section"

+

The "+" 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 "section" and may contain "group" use the query:

+section group

NOT

The NOT operator excludes documents that contain the term after NOT. The symbol ! can be used in place of the word NOT.

To search for documents that contain "section group" but not "uninstall section" use the query:

"section group" NOT "uninstall section"

Note: The NOT operator cannot be used with just one term. For example, the following search will return no results:

NOT "uninstall section"

-

The "-" operator excludes documents that contain the term after the "-" symbol.

To search for documents that contain "section group" but not "uninstall section" use the query:

"section group" -"uninstall section"

Grouping

Parentheses should be used 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 "section" or "group" and "uninstall" use the query:

(section OR group) AND uninstall

This eliminates any confusion and makes sure you that "uninstall" must exist and either term "section" or "group" may exist.

Escaping Special Characters

Special characters that are part of the query syntax should be escaped if they are part of the search terms. 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

Lucene © 1999-2005, The Apache Software Foundation