In an explicit query, the Verity search engine literally interprets your search terms. The following are two ways to perform an explicit query:
When you put a search term in quotation marks, Verity does not use the STEM operator. For example, a search for "instructional"--enclosed in quotation marks, as shown in Preventing stemming--does not return files that contain instruct, instructs, instructions, and so on (unless the files also contain instructional).
When you specify type="explicit" the search expression must be a valid Verity Query Language expression. As a result, an individual search term must be in explicit quotation marks. The following table shows valid and invalid criteria:
Attribute |
Effect |
---|---|
criteria="government" |
Generates an error |
criteria="'government'" or criteria='"government"' |
Finds only government |
criteria="<WORD>government" |
Finds only government |
criteria="<STEM>government" |
Finds government, governments, and governmental |
criteria="<MANY><STEM>government" |
Finds government, governments, and governmental ranked by relevance |
criteria="<WILDCARD>governmen*" |
Finds government, governments, and governmental |
Verity has many powerful operators and modifiers available for searching. However, users might only use the most basic operators--AND, OR, and the modifier NOT. The following are a few important points:
love "and" marriage
For more information, see Operators and modifiers.
The following table gives examples of searches and their results:
Search term |
Returns files that contain |
---|---|
doctorate AND nausea |
both doctorate and nausea |
doctorate "and" nausea |
the phrase doctorate and nausea |
"doctorate and nausea" |
the phrase doctorate and nausea |
masters OR doctorate AND nausea |
masters, or the combination of doctorate and nausea |
masters OR (doctorate AND nausea) |
masters, or the combination of doctorate and nausea |
(masters OR doctorate) AND nausea |
either masters or doctorate, and nausea |
masters OR doctorate NOT nausea |
either masters or doctorate, but not nausea |
Part of the strength of the Verity search is its use of wildcards and special characters to refine searches. Wildcard searches are especially useful when you are unsure of the correct spelling of a term. Special characters help you search for tags in your code.
The following table shows the wildcard characters that you can use to search Verity collections:
Wildcard |
Description |
Example |
Search result |
---|---|---|---|
? |
Matches any single alphanumeric character. |
apple? |
apples or applet |
* |
Matches zero or more alphanumeric characters. Avoid using the asterisk as the first character in a search string. An asterisk is ignored in a set, ([]) or an alternative pattern ({}). |
app*ed |
Appleseed, applied, appropriated, and so on |
[ ] |
Matches any one of the characters in the brackets. Square brackets indicate an implied OR. |
<WILDCARD> 'sl[iau]m' |
slim, slam, or slum |
{ } |
Matches any one of a set of patterns separated by a comma, |
<WILDCARD> 'hoist{s,ing,ed}' |
hoists, hoisting, or hoisted |
^ |
Matches any character not in the set. |
<WILDCARD>'sl[^ia]m' |
slum, but not slim or slam |
- |
Specifies a range for a single character in a set. |
<WILDCARD> 'c[a-r]t' |
cat, cot, but not cut (that is, every word beginning with c, ending with t, and containing any single letter from a to r) |
To search for a wildcard character as a literal, place a backslash character before it:
<cfsearch name = "quick_search" collection="bbb" type = "simple" criteria="'M\\*'">
Searching for special characters
The search engine handles a number of characters in particular ways as the following table describes:
Characters |
Description |
---|---|
, ( ) [ |
These characters end a text token. A token is a variable that stores configurable properties. It lets the administrator or user configure various settings and options. |
= > < ! |
These characters also end a text token. They are terminated by an associated end character. |
' ` < { [ ! |
These characters signify the start of a delimited token. They are terminated by an associated end character. |
To search for special characters as literals, precede the following nonalphanumeric characters with a backslash character (\) in a search string:
In addition to the backslash character, you can use paired backquote characters (` `) to interpret special characters as literals. For example, to search for the wildcard string "a{b" you can surround the string with back quotation marks, as follows:
`a{b`
To search for a wildcard string that includes the literal backquote character (`) you must use two backquote characters together and surround the entire string in back quotation marks:
`*n``t`
You can use paired back quotation marks or backslashes to escape special characters. There is no functional difference between the two. For example, you can query for the term: <DDA> using \<DDA\> or `<DDA>` as your search term.