Adobe 38043740 - ColdFusion Standard - Mac Development Manual page 502

Developing applications
Hide thumbs Also See for 38043740 - ColdFusion Standard - Mac:
Table of Contents

Advertisement

DEVELOPING COLDFUSION 9 APPLICATIONS
Accessing and Using Data
Working with data returned from a query
Using Verity, you can search data returned by a query—such as a database recordset—as if it is 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. A database can direct the indexing
process, by using different values for the
procedures for indexing the results of database and other queries.
Recordsets and types of queries
When indexing recordsets generated from a query (using the
based on the
attribute and its set value:
type
Type
Attribute values
File
The
attribute is the name of a column in the query that contains a full filename (including path).
key
Path
The
key
attribute is the name of a column in the query that contains a directory pathname.
Custom
The
attribute specifies a column name that can contain anything you want. In this case, the
key
required, and is a comma-delimited list of the names of the columns that contain the text data to be indexed.
The
tag treats all collections the same, whether they originate from a database recordset, or if they are a
cfindex
collection of documents stored within your website's root folder.
Indexing data returned by a query
Indexing the results of a query is like indexing physical files located on your website, with the added step that you must
write a query that retrieves the data to search. The following are the steps to perform a Verity search on recordsets
returned from a query:
1
Create a collection.
Write a query that retrieves the data you want to search, and generate a recordset.
2
Index the recordset using the
3
The
tag indexes the recordset as if it is a collection of documents in a folder within your website.
cfindex
4
Search the collection.
The information returned from the collection includes the database key and other selected columns. You can then
use the information as-is, or use the key value to retrieve the entire row from the database table.
Use Verity to search databases in the following cases:
• You want to perform full-text search on database data. You can search Verity collections that contain textual data
much more efficiently with a Verity search than using SQL to search database tables.
• You want to give your users access to data without interacting directly with the data source itself.
• You want to improve the speed of queries.
• You want users to be able to execute queries, but not update database tables.
Unlike indexing documents stored on your web server, indexing information contained in a database requires an
additional step— first write a query (using the
your users search. You then pass the information retrieved by the query to a
When indexing data with the
represents the document title, and which column (or columns) represents the document's body (the information that
you want to make searchable).
attribute of the
type
tag.
cfindex
, cfldap, or
cfquery
tag, specify which column of the query represents the filename, which column
cfindex
Last updated 1/20/2012
tag. There are also several reasons and
cfindex
, cfldap, or
tag),
cfquery
cfpop
tag) that retrieves the data you want to let
cfpop
tag, which indexes the data.
cfindex
497
creates indexes
cfindex
attribute is
body

Advertisement

Table of Contents
loading

This manual is also suitable for:

Coldfusion 9

Table of Contents