This interface lets you 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.
Using the cfsearch tag
You use the
cfsearch
to a standard ColdFusion query: both use a dedicated ColdFusion tag that requires a
attribute for their searches. The following table compares the two tags:
cfquery
Searches a data source
Requires name attribute
Uses SQL statements to specify search criteria
Returns variables keyed to database table field
names
Uses cfoutput to display query results
Note: You receive an error if you attempt to search a collection that has not been indexed.
The following are important attributes for the
•
name
The name of the search query.
•
collection
The name of the collection(s) being searched. Use a fully qualified path for an
external collection. Separate multiple collections with a comma; for example,
"sprocket_docs,CodeColl".
•
criteria
The search target (can be dynamic).
Each
cfsearch
•
RecordCount
•
CurrentRow
•
RecordsSearched
records were returned in the search, this property returns a null value.
Note: To use cfsearch to search a Verity K2 Server collection, the
collection's unique alias name as defined in the k2server.ini and the
(the default). For more detail, see Configuring and Administering ColdFusion MX.
You can use search form and results pages similar to the following examples to search a collection.
To create a search form:
Create a ColdFusion page with the following content:
1
<html>
<head>
<title>Searching a collection</title>
</head>
<body>
<h2>Searching a collection</h2>
<form method="post" action="collection_search_action.cfm">
tag to search an indexed collection. Searching a Verity collection is similar
returns variables that provide the following information about the search:
The total number of records returned by the search.
The current row of the record set being processed by
The total number of records in the index that were searched. If no
cfsearch
Searches a collection
Requires name attribute
Uses a criteria attribute to specify search criteria
Returns a unique set of variables
Uses cfoutput to display search results
tag:
cfsearch
collection
external
name
collection =
.
cfoutput
attribute must be the
attribute must be "No"
Using the cfsearch tag
523
Need help?
Do you have a question about the COLDFUSION MX 61-DEVELOPING COLDFUSION MX and is the answer not in the manual?
Questions and answers