User Guide

Table Of Contents
572 Chapter 24: Building a Search Interface
For more information on using the cfcollection tag to create Verity collections with support
for categories, see
cfcollection in Chapter 2, “ColdFusion Tags,” in CFML Reference.
Working with data returned from a query
Using Verity, you can search data returned by a query—such as a database record set—as if it were
a collection of documents stored on your web server. Using Verity to search makes implementing
a search interface much easier, as well as letting users more easily find information contained in
database files. This section describes the reasons and procedures for indexing the results of
database and other queries. It also describes how a database can direct the indexing process, using
different values for the
type attribute of the cfindex tag.
This section describes the following topics:
“Recordsets and types of querieson page 572
“Indexing data returned by a query” on page 573
“Indexing a file returned using a query” on page 576
“Indexing a path returned using a query” on page 577
“Indexing query results obtained from an LDAP directory” on page 578
“Indexing cfpop query results” on page 579
Recordsets and types of queries
When indexing record sets generated from a query (using the
cfquery, cfldap, or cfpop tag),
cfindex creates indexes based on the type attribute and its set value:
The
cfindex tag treats all collections the same, whether they originate from a database recordset,
or if they are a collection of documents stored within your websites root folder.
Type Attribute values
File The key attribute is the name of a column in the query that contains a full filename
(including path).
Path The
key attribute is the name of a column in the query that contains a directory
pathname.
Custom The
key attribute specifies a column name that can contain anything you want. In this
case, the
body attribute is required, and is a comma-delimited list of the names of the
columns that contain the text data that is to be indexed.