The Verity engine performs searches against collections. A collection is a special database created by Verity that contains pointers to the indexed data that you specify for that collection. ColdFusion's Verity implementation supports collections of three basic data types:
You can build a collection from individual documents or an entire directory tree. Collections can be stored anywhere, so you have a lot of flexibility in accessing indexed data. This adds enormous value to any content-rich Web site.
ColdFusion provides twodifferent ways to create a Verity collection. You can:
![]() |
To create a new collection: |
If you checked the option to install the ColdFusion Documentation, the documentation collection is listed by default. The Verity engine is used to search our online documents.
By default, new collections are added to \Cfusion\Verity\Collections\
.
When the collection is created, the name and full path of the new collection appear in the Verity Collections list at the top of the page.
You can easily enable access to a collection on the network by creating a local reference (an alias) for that collection. It only needs to be a valid Verity collection; it doesn't matter whether it was created within ColdFusion or another tool.
![]() |
To add an existing collection: |
If the collection is subsequently moved, the alias path must be updated. The Delete command, when used on a mapped collection, only deletes the alias.
Creating and maintaining collections from a CFML application eliminates the need to access the ColdFusion Administrator. This can be an advantage when you need to schedule these tasks or to allow users to perform them without exposing the Administrator to users.
![]() |
To create a simple collection form page: |
<HTML> <HEAD> <TITLE>Collection Creation Input Form</TITLE> </HEAD> <BODY> <H2>Specify a collection</H2> <FORM ACTION="collectioncreateaction.cfm" METHOD="POST"> <P>Collection name: <INPUT TYPE="text" NAME="CollectionName" SIZE="25"></P> <P>What do you want to do with the collection?</P> <INPUT TYPE="radio" NAME="CollectionAction" VALUE="Create" checked>Create<BR> <INPUT TYPE="radio" NAME="CollectionAction" VALUE="Repair">Repair<BR> <INPUT TYPE="radio" NAME="CollectionAction" VALUE="Optimize">Optimize<BR> </P> <INPUT TYPE="submit" NAME="submit" VALUE="Submit"> </FORM> </BODY> </HTML>
collectioncreateform.cfm
.
Note that this file simply shows how the form variables are used and does not perform error checking.
![]() |
To create a collection action page: |
<HTML> <HEAD> <TITLE>CFCOLLECTION</TITLE> </HEAD> <BODY> <H2>Collection creation</H2> <CFOUTPUT> <CFSWITCH EXPRESSION=#FORM.CollectionAction#> <CFCASE VALUE="Create"> <CFCOLLECTION ACTION="Create" COLLECTION="#FORM.CollectionName#" PATH="C:\CFUSION\Verity\Collections\"> <P>The collection #FORM.CollectionName# is created. </CFCASE> <CFCASE VALUE="Repair"> <CFCOLLECTION ACTION="REPAIR" COLLECTION="#FORM.CollectionName#"> <P>The collection #FORM.CollectionName# is repaired. </CFCASE> <CFCASE VALUE="Optimize"> <CFCOLLECTION ACTION="OPTIMIZE" COLLECTION="#FORM.CollectionName#"> <P>The collection #FORM.CollectionName# is optimized. </CFCASE> <CFCASE VALUE="Delete"> <CFCOLLECTION ACTION="DELETE" COLLECTION="#FORM.CollectionName#"> <P>Collection deleted. </CFCASE> </CFSWITCH> </CFOUTPUT> </BODY> </HTML>
collectioncreateaction.cfm
.
collectioncreateform.cfm
in your browser, enter values and submit the form.