Detailed instructions for use are in the User's Guide.
[. . . ] Developing Web Applications with ColdFusion
ColdFusion 4. 5
Allaire Corporation
Copyright Notice
© 1999 Allaire Corporation. This manual, as well as the software described in it, is furnished under license and may be used or copied only in accordance with the terms of such license. The content of this manual is furnished for informational use only, is subject to change without notice, and should not be construed as a commitment by Allaire Corporation. Allaire Corporation assumes no responsibility or liability for any errors or inaccuracies that may appear in this book. [. . . ] Note that in this example, angle brackets are used with the OR operator.
<OR> (a, b)
Delimiters in expressions
Angle brackets < >, double quotation marks " ", and backslashes \ are used to delimit various elements in a query expression.
Angle brackets for operators
Left and right angle brackets < > are reserved for designating operators and modifiers. They are optional for the AND, OR, and NOT operators, but required for all other operators.
Double quotation marks in expressions
You use double quotation marks to search for a word that is otherwise reserved as an operator, such as AND, OR, and NOT.
Backslashes in expressions
To include a backslash \ in a search, insert two backslashes for each backslash character you want to search for, such as C:\\CFUSION\\BIN.
170
Developing Web Applications with ColdFusion
Searching with Wildcards
This table shows the wildcard characters for searching Verity collections.
Verity Wildcard Characters Wildcard
?Specifies one of any character in a set, as in "sl[iau]m" which locates "slim, " "slam, " and "slum. " Square brackets indicate an implied OR. Specifies one of each pattern separated by a comma, as in "hoist{s, ing, ed}" which locates "hoists, " "hoisting, " and "hoisted. " Curly braces indicate an implied AND. Specifies one of any character not in the set as in "sl[^ia]m" which locates "slum" but not "slim" or "slam. " Hyphen. Specifies a range of characters in a set as in "c[a-r]t" which locates every word beginning with "c, " ending with "t, " and containing any letter from "a" to "r. "
[]
{}
^ -
Searching for wildcards as literals
To search for a wildcard character in your collection, you need to escape the character with a backslash (\). For example: To match a literal asterisk, you precede the * with two backslashes: "a\\*" To match a question mark or other wildcard character: "Checkers\?"
Searching for special characters as literals
The following non-alphanumeric characters must be preceded by a backslash character (\) in a search string: · comma (, ) · left and right parentheses () · double quotation mark (") · backslash (\) · at sign (@)
Chapter 11: Indexing and Searching Data
171
· left curly brace ({) · left bracket ([) · less than sign (<) · backquote (` ) In addition to the backslash character, you can use paired backquotes (` ` ) to interpret special characters as literals. For example, to search for the wildcard string "a{b" you can surround the string with backquotes, as follows:
`a{b`
To search for a wildcard string that includes the literal backquote character (` ) you must use two backquotes together and surround the whole string in backquotes:
`*n``t`
Note that you can use either paired backquotes or backslashes to escape special characters. For example, you can query for the term: <DDA> in the following ways:
\<DDA\> or `<DDA>`
Operators and Modifiers
The power of the CFSEARCH tag is in the control it gives you over the Verity search engine. The engine offers users a high degree of specificity in setting search parameters.
Operators
An operator represents logic to be applied to a search element. This logic defines the qualifications a document must meet to be retrieved. Operators are used to refine your search or to influence the results in other ways. For example, you could construct an HTML form for conducting searches. You can refine your search by limiting the search scope in a number of ways. Operators are available for limiting a query to a sentence or paragraph, and you can search words based on proximity. The following operator types are available: · Evidence operators -- Used to specify basic and intelligent word searches. · Proximity operators -- For specifying the relative location of words in a document. · Concept operators -- Used to identify a concept in a document by combining the meanings of search elements. · Score operators -- Allow you to manipulate the score returned by a search element. The score percentage display can optionally be set to as many as four decimal places.
172
Developing Web Applications with ColdFusion
· Natural language operators -- Allow the use of natural language expressions in forming queries. They are used in the following manner:
"<operator>search_string"
Evidence operators
Evidence operators can be used to specify either a basic word search or an intelligent word search. A basic word search finds documents that contain only the word or words specified in the query. [. . . ] If there are no statements, you should comment out the entire CFSCRIPT block (including its enclosing <CFSCRIPT> and </CFSCRIPT> blocks) with CFML comment tags. You can read and write ColdFusion variables inside CFScript, as shown in this example:
344
Developing Web Applications with ColdFusion
<CFOUTPUT QUERY="employees"> <CFSCRIPT> //`testres' is a column in the "employees" query if( testres EQ 1 ) result="positive"; else result="negative"; </CFSCRIPT> <!--- The variable result takes its value from the script region ---> Test for #name# is #result#. </CFOUTPUT>
CHAPTER 21
Chapter 21
Accessing the Windows NT Registry
The CFREGISTRY tag gives you programmatic access to the Windows Registry.
Contents
· · · · Overview of Registry Access in ColdFusion . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 346 Getting Registry Values . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . [. . . ]