User Guide

Table Of Contents
560 Chapter 24: Building a Search Interface
To use cfindex to index a collection:
1.
Create a ColdFusion page with the following content:
<html>
<head>
<title>Creating Index</title>
</head>
<body>
<h2>Indexing Complete</h2>
<cfindex collection="#Form.IndexColl#"
action="refresh"
extensions=".htm, .html, .xls, .txt, .mif, .doc"
key="#Form.IndexDir#"
type="path"
urlpath="#Form.urlPrefix#"
recurse="Yes"
language="English">
<cfoutput>
The collection #Form.IndexColl# has been indexed.
</cfoutput>
</body>
</html>
2.
Save the file as collection_index_action.cfm.
3.
In the web browser, enter the following URL to display the form page:
http://hostname:portnumber/myapps/collection_index_form.cfm
4.
Enter a collection name; for example, CodeColl.
5.
Enter a file location; for example, C:\CFusionMX7\wwwroot\vw_files.
6.
Enter a URL prefix; for example, http://localhost:8500/vw_files (assuming that you are using
the built-in web server).
7.
Click Index.
A confirmation message appears on successful completion.
Note: For information about using the cfindex tag with a database to index a collection, see
“Working with data returned from a query” on page 572.
Indexing a collection with the ColdFusion MX Administrator
As an alternative to programmatically indexing a collection, use the following procedure to index
a collection with the ColdFusion MX Administrator.
To use ColdFusion MX Administrator to index a collection:
1.
In the list of Verity Collections, select a collection name; for example, CodeColl.
2.
Click Index to open the index page.
3.
For File Extensions, enter the types of files to index. Use a comma to separate multiple file types;
for example, .htm, .html, .xls, .txt, .mif, .doc.