User Guide

Table Of Contents
Creating a search tool for ColdFusion applications 559
You can use form and action pages similar to the following examples to select and index a
collection.
To select which collection to index:
1.
Create a ColdFusion page with the following content:
<html>
<head>
<title>Select the Collection to Index</title>
</head>
<body>
<h2>Specify the index you want to build</h2>
<form method="Post" action="collection_index_action.cfm">
<p>Enter the collection you want to index:
<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>
<p>Enter a Return URL to prepend to all indexed files:
<input type="text" name="urlPrefix" size="80" maxLength="100"></p>
<input type="submit" name="submit" value="Index">
</form>
</body>
</html>
2.
Save the file as collection_index_form.cfm in the myapps directory under the web_root.
Note: The form does not work until you write an action page for it, which is the next procedure.
URLpath
(Optional) The URL path for files if type="file" and type="path". When the
collection is searched with the
cfsearch tag, ColdFusion MX works as follows:
type="file" The URLpath attribute contains the URL to the file.
type="path" The path name is automatically prefixed to filenames and
returned as the
URLpath attribute.
recurse
(Optional) Yes or No. If type = "path" , Yes specifies that directories below the path
specified in the key attribute are included in the indexing operation.
language
(Optional) The language of the collection. The default is English Basic.
To learn more about support for languages, see “Specifying a language”
on page 551.
Attribute Description