Chapter 11: Indexing and Searching Data
159
To use CFINDEX to index a collection:
1.
Open a new file in Studio.
2.
Modify the file so that it appears as follows:
<HTML>
<HEAD>
<TITLE>Creating Index</TITLE>
</HEAD>
<BODY>
<H2>Indexing Complete</H2>
<CFINDEX COLLECTION="#Form.IndexColl#"
KEY="#Form.IndexDir#"
ACTION="REFRESH"
TYPE="PATH"
URLPATH="#Form.IndexDir#"
EXTENSIONS=".htm, .html"
RECURSE="Yes"
LANGUAGE="English">
<CFOUTPUT>
The collection #Form.IndexColl# has been indexed.
</CFOUTPUT>
</BODY>
</HTML>
3.
Save the file as
collectionindexaction.cfm
4.
View
collectionindexform.cfm
in your browser, enter values, and then click
Index.
Building a Search Interface
Now that you’ve created and indexed a searchable data source, you need to build a
search interface to allow users to access the data source. The CFSEARCH tag provides
users with a set of operators and modifiers to create sophisticated query expressions.
We’ll explore these options in detail below, but first let’s take a look at getting a basic
search application up and running.
Using the Verity wizard in Studio
To quickly create a search application for an existing collection, click the File > New
command in ColdFusion Studio and select the Verity Wizard in the CFML tab of the
New Document dialog. The wizard creates a set of application pages based on the
entries you make in the wizard dialogs.
You can customize the search interface by adding instructional text for users and
applying styles to the form pages.
Summary of Contents for COLDFUSION 4.5-DEVELOPING WEB
Page 1: ...Allaire Corporation Developing Web Applications with ColdFusion ColdFusion 4 5...
Page 14: ...xiv Developing Web Applications with ColdFusion...
Page 26: ...xxvi Developing Web Applications with ColdFusion...
Page 34: ...8 Developing Web Applications with ColdFusion...
Page 70: ...44 Developing Web Applications with ColdFusion...
Page 84: ...58 Developing Web Applications with ColdFusion...
Page 114: ...88 Developing Web Applications with ColdFusion...
Page 148: ...122 Developing Web Applications with ColdFusion...
Page 174: ...148 Developing Web Applications with ColdFusion...
Page 208: ...182 Developing Web Applications with ColdFusion...
Page 244: ...218 Developing Web Applications with ColdFusion...
Page 274: ...248 Developing Web Applications with ColdFusion...
Page 288: ...262 Developing Web Applications with ColdFusion...
Page 300: ...274 Developing Web Applications with ColdFusion...
Page 350: ...324 Developing Web Applications with ColdFusion...
Page 362: ...336 Developing Web Applications with ColdFusion...