Searching in Zones


This section describes how users can search in zones when the zone filter is implemented.

Zones can be searched in two ways:

Each of these methods is described in this section.

Using the Query Language IN Operator

Use the IN operator to search within zones.

The syntax of the IN operator is:

(query) <IN> zone

or

(query) <IN> (zone1, zone2, ...)

query represents any query expression. To preclude ambiguity, the query expression must be placed within parentheses. The zone variables represent the zone names. The zone name supplied must match the zone names defined in your collections. If more than one zone is to be searched, they must appear in a comma-separated list with parentheses surrounding them.

IN Operator Examples

The following examples illustrate the proper use of the IN operator.

To search in the zone named summary using the topic named safety, use the following query expression:

(safety) <IN> summary

To search in two zones, summary and title, using the topic named safety, use the following query expression syntax:

(safety) <IN> (summary, title)

If the query expression contains a comma, enclose the query expression in parentheses. Thus, to search in the zone summary using the query "safety, environmental regulation," use the following query expression:

(safety, environmental regulation) <IN> summary

To search using the previous query in the summary and title zones, use the following query expression:

(safety, environmental regulation) <IN> (summary, title)

To specify searching a zone nested within a zone, nest the IN operator, as shown in the following example:

((happiness <AND> health) <IN> subsection) <IN> section

If you specify a query expression with the IN operator, and no zones have been defined for your collections, the search yields no results. No documents will be retrieved when zones have not been defined.

Using a Custom Query Parser

If you are using a custom query parser, you can set a field in the VdkQParserNewArgRec called defaultZone. This has the same effect as applying <IN> zone to the end of the custom query you define. This field should point to a string that is the zone specification for the search. You can leave this field NULL if you do not want to restrict the search to a particular zone.

You might use the defaultZone field when defining a form search, and restrict each field in the form to search within one particular zone:


To: ____________ (search for this in the To zone)
Subject: ____________ (search for this in the Subject zone)
From: ____________ (search for this in the From zone)

Searching Multiple Zone Occurrences

When you create a zone, it may occur only once in the document (as in the case of the <title> tag extracted as a zone), or it may occur multiple times in a document (as in an <h2> tag extracted as a zone). When a zone occurs more than once in a document, you can search for words that appear together in the same occurrence of the zone, or you can search for words without respect to whether or not they appear in the same occurrence of the zone.

To search for two words appearing together in the same occurrence of the zone, use the standard syntax as described above, for example:

(health <AND> safety) <IN> h2

To search for the two words without regard to whether they appear in the same occurrence of the zone, use the following syntax:

(health <IN> h2) <AND> (safety <IN> h2)





Copyright © 2002, Verity, Inc. All rights reserved.