Chapter 11: Indexing and Searching Data
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#"
<CFOUTPUT>
</CFOUTPUT>
</BODY>
</HTML>
3.
Save the file as
4.
View
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.
KEY="#Form.IndexDir#"
ACTION="REFRESH"
TYPE="PATH"
URLPATH="#Form.IndexDir#"
EXTENSIONS=".htm, .html"
RECURSE="Yes"
LANGUAGE="English">
The collection #Form.IndexColl# has been indexed.
collectionindexaction.cfm
collectionindexform.cfm
in your browser, enter values, and then click
159
Need help?
Do you have a question about the COLDFUSION 4.5-DEVELOPING WEB and is the answer not in the manual?