
482
DEVELOPING
COLDFUSION 9 APPLICATIONS
Accessing and Using Data
Las
t
upda
te
d 8/5/2010
For more information on selecting a language, see “
Specifying a language
” on page 479.
5
(Optional) Select Enable Category Support to create a Verity Parametric collection.
For more information on using categories, see “
Narrowing searches by using categories
” on page 492.
6
Click Create Collection.
The name and full path of the new collection appears in the list of Verity Collections.
You have successfully created an empty collection. A collection becomes populated with data when you index it.
About indexing a collection
In order for information to be searched, it must be indexed. Indexing extracts both meaning and structure from
unstructured information by indexing each document that you specify into a separate Verity collection that contains
a complete list of all the words used in a given document along with metadata about that document. Indexed
collections include information such as word proximity, metadata about physical file system addresses, and URLs of
documents.
When you index databases and other recordsets that you generated using a query, Verity creates a collection that
normalizes both the structured and unstructured data. Search requests then check these collections rather than
scanning the actual documents and database fields. This provides a faster search of information, regardless of the file
type and whether the source is structured or unstructured.
Just as with creating a collection, you can index a collection programmatically or by using the ColdFusion
Administrator. Use the following guidelines to determine which method to use:
You can use
cfcollectionaction="optimize"
if you notice that searches on a collection take longer than they did
previously.
Updating an index
Documents are modified frequently in many user environments. After you index your documents, any changes that
you make are not reflected in subsequent Verity searches until you reindex the collection. Depending on your
environment, you can create a scheduled task to automatically keep your indexes current. For more information on
scheduled tasks, see
Configuring and Administering ColdFusion
.
Creating a ColdFusion search tool programmatically
You can create a Verity search tool for your ColdFusion application in CFML. Although writing CFML code can take
more development time than using these tools, in some situations, writing code is the preferred development method.
Creating a collection with the cfcollection tag
The following are cases in which you might prefer using the
cfcollection
tag rather than the ColdFusion
Administrator to create a collection:
•
You want your ColdFusion application to be able to create, delete, and maintain a collection.
Use the Administrator
Use the cfindex tag
To index document files
To index ColdFusion query results
When the collection does not require frequent updates
When the collection requires frequent updates
To create the collection without writing any CFML code
To dynamically update a collection from a ColdFusion application page
To create a collection once
When the collection requires updating by others