Search Methods for Simple Queries


As you get used to writing simple queries, you may want to ask your question in a way that leads the search engine to apply logic to the terms included in your query.

You can do this by writing query expressions that combine the words and phrases you're accustomed to using with just a few of the operators and modifiers available as part of the Verity Query Language. The most frequently-used operators and modifiers allow you to perform basic searching and proximity searching, as described below. For more information, see the previous section "Writing Simple Queries" and the online Search Tips resource.

You can do additional types of searches, depending on the types of collections you are searching. For example, you can do zone searching if you have collections of HTML documents, and field searching if your collection has been defined to include fields, such as the document's date, title, and author.

NOTE: In the examples that follow, operators and modifiers are shown in upper case. Queries, including operators and modifiers, are not case-sensitive. This convention merely indicates that these words are being used as part of the query language.

Proximity Searching

You can focus the search more closely by telling the search engine to retrieve documents that contain the search terms in close proximity to each other: that is, near each other, in the same sentence, or in the same paragraph. The operators used for proximity searching are NEAR, SENTENCE, and PARAGRAPH.

The NEAR operator selects documents containing specified search terms within close proximity to each other. Document scores are calculated based on the relative number of words between search terms: the closer the search terms, the higher the score. To find documents that contain the word "HTML" and stemmed variations of the word "publishing" within close proximity of each other, use this query:

"HTML" <NEAR> publishing

The SENTENCE and PARAGRAPH operators are used to specify a search within a sentence and paragraph. The syntax for using these operators is similar. To find documents that contain the word "HTML" and stemmed variations of the word "publishing" within the same paragraph, use this query:

"HTML" <PARAGRAPH> publishing

NOTE: All operators and modifiers except the reserved words AND, OR, and NOT must be surrounded by left and right angle brackets (< >). By default, AND, OR, and NOT are interpreted as query language; all other query language elements are interpreted as words unless they are surrounded by angle brackets. Some examples in this guide show AND, OR, and NOT with angle brackets, and some without. You can enter expressions either way. Both of the following examples mean: Look for documents that contain the word "future" and the word "trends:"


future <AND> trends
future AND trends

Zone Searching

You can search in any named HTML zone, such as <TITLE> and <H1>. An HTML zone refers to a region of text within an HTML document that is defined to be the text assigned to an HTML tag. Thus, an HTML document has as many zones as the tags it contains.

You can search over an HTML zone if you have collections of HTML documents. To specify a query expression for a zone search, you need to give a zone name. A zone name corresponds to the HTML tag name. The zone name is combined with a query and the IN operator in the query expression. For example, this query will find documents whose titles have stemmed variations of the word "web" in them:

web <IN> title

The query can consist of words and phrases separated by commas, and it can be a query expression using the Verity Query Language. To search with multiple words, phrases, or query expressions, enclose that portion of the query in parentheses. This query will find documents whose titles have stemmed variations of the words "web" and "security" in them:

(web, security) <IN> title

Field Searching

When a collection is created, the application administrator can define fields to store information about documents, such as the document's date, title, and author. You can use this information as search criteria for the documents you want to find. A field search differs from a full-text search in that a field search searches only specified fields, while a full-text search searches all the words that comprise document text. You can search over the field values stored for documents to find information that is relevant to your search. For example, you can search for all documents by a certain author.

Typically, users combine field searches with full text searches. For example, if you were interested in finding a particular memo written on June 18, 1996 on the subject of a project named "Picasso," you could use the following query expression to search document text for the word "Picasso" and the date field for June 18, 1996:

picasso AND (DATE = 06-18-96)

In the example above, note that the date field must be defined as a date field assigned the "date" data type.

In Information Server, the following fields can be searched:

Field
Description
Title
Title of the hit document.
Snippet
Special field containing the first 400 printable characters in each document.
Mime-Type
Type of document: Plain, HTML, or PDF.
Size
Length or size of document (collection field available for documents indexed with the Web Indexer).
Modified
Date a document was last modified (collection field available for documents indexed with the Web Indexer).

In addition, some documents contain the following fields:

Field
Description
Ext
The document file name extension. Defined as the last 3 or 4 characters after the period.
Author
The author of the document, as defined the Summary Information of some WYSIWYG documents.
Subject
The subject of the document. Found for example, in e-mail messages and Usenet news postings.
Keywords
Keywords in the document, as defined the Summary Information of some WYSIWYG documents.
Comments
The comments field of the document, as defined the Summary Information of some WYSIWYG documents.
Created
The date the document was created.





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