278
Using cfindex
You can use a form page an action page similar to the following examples to select a
collection and index it.
To select which collection to index:
1
2
3
To use cfindex to index a collection:
1
2
Open a new file in ColdFusion Studio.
Modify the file so that it appears as follows:
<html>
<head>
<title>Select the Collection to Index</title>
</head>
<h2>Specify the index you want to build</h2>
<form method="Post" action="collectionindexaction.cfm">
<p>Enter the collection you want to populate:
<input type="text" name="IndexColl" size="25" maxLength="35"></p>
<p>Enter the location of the files in the collection:
<input type="text" name="IndexDir" size="50" maxLength="100"></p>
<input type="submit" name="submit" value="Index">
</form>
</body>
</html>
Save the file as
collectionindexform.cfm
Open a new file in ColdFusion Studio.
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">
Chapter 15 Indexing and Searching Data
Need help?
Do you have a question about the COLDFUSION 5-DEVELOPING and is the answer not in the manual?
Questions and answers