Refining Your Searches With Zones And Fields - MACROMEDIA COLDFUSION MX 61-DEVELOPING COLDFUSION MX Develop Manual

Developing coldfusion mx applications
Table of Contents

Advertisement

Refining your searches with zones and fields

One of the strengths of Verity is its ability to perform full-text searches on documents of many
formats. However, there are often times when you want to restrict a search to certain portions of a
document, to improve search relevance. If a Verity collection contains some documents about
baseball and other documents about caves, then a search for the word bat might retrieve several
irrelevant results.
If the documents are structured documents, you can take advantage of the ability to search zones
and fields. The following are some examples of structured documents:
Documents created with markup languages (XML, SGML, HTML)
Internet Message Format documents
Documents created by many popular word-processing applications
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
zones. When you use the zone filter, the Verity engine builds zone information into the
collection's 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">
552
Chapter 25: Using Verity Search Expressions
505. Verity searches XML files by treating the XML tags as

Advertisement

Table of Contents
loading

This manual is also suitable for:

Coldfusion mx

Table of Contents