552
Chapter 25: Using Verity Search Expressions
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 505
. 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
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”>
Содержание ColdFusion MX
Страница 1: ...Developing ColdFusion MX Applications...
Страница 22: ...22 Contents...
Страница 38: ......
Страница 52: ...52 Chapter 2 Elements of CFML...
Страница 162: ......
Страница 218: ...218 Chapter 10 Writing and Calling User Defined Functions...
Страница 250: ...250 Chapter 11 Building and Using ColdFusion Components...
Страница 264: ...264 Chapter 12 Building Custom CFXAPI Tags...
Страница 266: ......
Страница 314: ...314 Chapter 14 Handling Errors...
Страница 344: ...344 Chapter 15 Using Persistent Data and Locking...
Страница 349: ...About user security 349...
Страница 357: ...Security scenarios 357...
Страница 370: ...370 Chapter 16 Securing Applications...
Страница 388: ...388 Chapter 17 Developing Globalized Applications...
Страница 408: ...408 Chapter 18 Debugging and Troubleshooting Applications...
Страница 410: ......
Страница 426: ...426 Chapter 19 Introduction to Databases and SQL...
Страница 476: ...476 Chapter 22 Using Query of Queries...
Страница 534: ...534 Chapter 24 Building a Search Interface...
Страница 556: ...556 Chapter 25 Using Verity Search Expressions...
Страница 558: ......
Страница 582: ...582 Chapter 26 Retrieving and Formatting Data...
Страница 668: ......
Страница 734: ...734 Chapter 32 Using Web Services...
Страница 760: ...760 Chapter 33 Integrating J2EE and Java Elements in CFML Applications...
Страница 786: ...786 Chapter 34 Integrating COM and CORBA Objects in CFML Applications...
Страница 788: ......
Страница 806: ...806 Chapter 35 Sending and Receiving E Mail...