User Guide

Table Of Contents
602 Chapter 25: Using Verity Search Expressions
Note: Although your word processor might open with what appears to be a blank page, the document
has many regions such as title, subject, and author. Refer to your application’s documentation or
online help system for how to view a document’s properties.
Zone searches
You can perform zone searches on markup language documents. The Verity zone filter includes
built-in support for HTML and several file formats; for a list of supported file formats, see
“Building a Search Interface” on page 547. Verity searches XML files by treating the XML tags as
zones. When you use the zone filter, the Verity engine builds zone information into the
collections full-word index. This index, enhanced with zone information, permits quick and
efficient searches over zones. The zone filter can automatically define a zone, or you can define it
yourself in the style.zon file. You can use zone searching to limit your search to a particular zone.
This can produce more accurate, but not necessarily faster, search results than searching an entire
file.
Note: The contents of a zone cannot be returned in the results list of an application.
Examples
The following examples perform zone searching on XML files. In a list of rock bands, you could
have XML files with tags for the instruments and for comments. In the following XML file, the
word Pete appears in a comment field:
<band.xml>
<Lead_Guitar>Dan</Lead_Guitar>
<Rhythm_Guitar>Jake</Rhythm_Guitar>
<Bass_Guitar>Mike</Bass_Guitar>
<Drums>Chris</Drums>
<COMMENT_A>Dan plays guitar, better than Pete.</COMMENT_A>
<COMMENT_B>Jake plays rhythm guitar.</COMMENT_B>
</band.xml>
The following CFML code shows a search for the word Pete:
<cfsearch name = "band_search"
collection="my_collection"
type = "simple"
criteria=”Pete”>
The above search for Pete returns this XML file because this search target is in the
COMMENT_A field. In contrast, Pete is the lead guitarist in the following XML file:
<band.xml>
<Lead_Guitar>Pete</Lead_Guitar>
<Rhythm_Guitar>Roger</Rhythm_Guitar>
<Bass_Guitar>John</Bass_Guitar>
<Drums>Kenny</Drums>
<COMMENT_A>Who knows who's better than this band?</COMMENT_A>
<COMMENT_B>Ticket prices correlated with decibels.</COMMENT_B>
</band.xml>
To retrieve only the files in which Pete is the lead guitarist, perform a zone search using the IN
operator according to the following syntax:
(query) <IN> (zone1, zone2, ...)