Adobe 38043740 - ColdFusion Standard - Mac Development Manual page 439

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

Advertisement

DEVELOPING COLDFUSION 9 APPLICATIONS
Accessing and Using Data
Using Query of Queries with non-SQL recordsets
A Query of Queries can operate on any CFML tag or function that returns a recordset; you are not limited to operating
on
results. You can perform queries on non-SQL recordsets, such as a
cfquery
tag, and so on.
cfldap
The following example shows how a Query of Queries interacts with the recordset of a Verity search. This example
assumes that you have a valid Verity collection, called bbb, which contains documents with a target word, film, or its
variants (films, filmed, filming). Change the name of the collection and the search criteria to as appropriate for your
Verity collection. For more information on Verity, see
Use Query of Queries with a Verity recordset
Create a ColdFusion page with the following content:
1
<html>
<head>
<title>QoQ and Verity</title>
</head>
<body>
<!--- Master query: retrieve all documents from the bbb collection
that contain 'film' (or its stemmed variants); change values for
collection and criteria as needed for your Verity collection. --->
<cfsearch name = "quick"
collection="bbb"
type = "simple"
criteria="film">
<h3>Master query dump:</h3>
<cfdump var="#quick#">
<!--- Detail query: retrieve from the master query only those
documents with a score greater than a criterion (here,
0.7743). --->
<cfquery name="qoq" dbtype="query">
SELECT * from quick
WHERE quick.score > 0.7743
</cfquery>
<h3>Detail query dump:</h3>
<cfdump var="#qoq#">
</body>
</html>
2
Save the page as qoq_verity.cfm in the myapps directory under the web_root.
Display qoq_verity.cfm in your browser
3
The next example shows how a Query of Queries combines recordsets from a
retrieval of one file type per use.
Use Query of Queries to combine recordsets
1
Create a ColdFusion page with the following content:
"Building a Search
Last updated 1/20/2012
tag, a
cfdirectory
cfsearch
Interface" on page 476.
tag, which is limited to
cfdirectory
434
tag, a

Advertisement

Table of Contents
loading

This manual is also suitable for:

Coldfusion 9

Table of Contents