At this point, the new collection is just an empty shell. To populate the collection with indexed data, you can use either of two methods:
You can use the Verity Wizard in ColdFusion Studio to create the templates to make yur documents searchable. To run the wizard, click File > New and select the Verity Wizard from the CFML tab of the New Document dialog.
Note | You can index and search against Verity collections created outside of ColdFusion by using the EXTERNAL attribute of CFINDEX and CFSEARCH. |
Use the following guidelines to determine which method to use.
Using the CF Administrator or CFINDEX | |
---|---|
Use the Administrator if | Use the CFINDEX tag if |
You want to index document files. | You want to index ColdFusion query results. |
The collection won't be updated very frequently. | You need to dynamically populate or update a collection from a ColdFusion application page. |
You want to generate the collection without writing any CFML code. | Your collection needs to be updated frequently. |
You want to generate a one-time collection. | Your collection needs to be updated by other people. |
![]() |
To use ColdFusion Administrator to index a collection: |
http://localhost/wwwroot/
.
As you can see, this interface allows you to easily build a very specific index based on the file extension and path information you enter. In most cases, you do not need to change your server file structures to accommodate the generation of indices.
In your ColdFusion application, you can populate and search multiple collections, each of which can be designed to focus on a specific group of documents or queries, according to subject, document type, location, or any other logical grouping. Searches can be performed against multiple collections, giving you lots of flexibility in designing your search interface.
![]() |
To select which collection to index: |
<HTML> <HEAD> <TITLE>Select the Collection to Index</TITLE> </HEAD> <H2>Pick which 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>
collectionindexform.cfm
![]() |
To use CFINDEX to index a collection: |
<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>
collectionindexaction.cfm
collectionindexform.cfm
in your browser, enter values, and then click Index.