User Guide
Using Query Expressions 285
type="custom"
title="subject"
query="p_messages"
body="body">
<!--- Search messages for the word "action" --->
<cfsearch collection="pop_query"
name="s_messages"
criteria="action">
<!--- Output search result set --->
<cfoutput query="s_messages">
#key#, #title# <br>
</cfoutput>
Using Query Expressions
When you search a Verity collection, you use the cfsearch tag in a ColdFusion
application page. Use the
criteria attribute to specify the query expression you
want to pass to the search engine.
You can build two types of query expressions: simple and explicit. A simple query
expression is typically a word or words. An explicit query expression can employ a
number of operators and modifiers to refine the search, and you must invoke all
aspects of the search explicitly. A simple query expression employs operators by
default. You can assemble an explicit query expression programmatically, or you can
pass a simple query expression to the search engine directly from an HTML input
form.
The Verity query language provides many operators and modifiers for composing
queries. You can use the following search techniques to search a Verity collection:
• Word searches
• Proximity searches
• Concept–based searches
• Field searches in which documents are matched based on matching predefined
custom attributes
• Scoring operators
Simple query expressions
Simple queries let end users enter simple, comma-delimited strings and use
wildcard characters. Users can enter multiple words separated by commas, in which
case the comma is treated like a logical OR. If a user omits the commas, the query
expression is treated as a phrase.
Ordinarily, operators are employed in explicit query expressions. Operators are
normally surrounded by angle brackets (< >). However, a simple query expression
can include the AND, OR, and NOT operators without angle brackets.