Search Syntax


Contents:


Most of the time, you can probably find what you want in the iPlanet Compass Server by browsing categories and searching for keywords. However, sometimes you may need to perform a more complicated search.

In most cases, the Advanced Search page will be the easiest way to construct a complex query. However, you can also type complex query syntax directly into the search box.

There are two kinds of syntax tools you can use to create complex queries by hand, you can use both wildcards and query operators in the same search.


Wildcard Characters

Wildcard characters are special characters that stand for various other characters or groups of characters in a search. For example, in a query a question mark (?) is a wildcard character representing any letter or number. Thus, if you enter the search criteria ca? your search will find ca1, cab, cad, cam, can, cop, car, cat, and so forth.

There are two wildcard characters.

Wildcard What it does
Question mark (?)

Matches any single character.

For example, searching for t?p matches any of the words tap, tip, and top. Searching for all???? finds words such as ballpark, ballroom, balladry, and ballyhoo. Would not find ballet or balloon because they do not have exactly four additional letters as represented by the question marks after ball. Would not find baseball because the wildcards are after ball, not before.

Asterisk (*)

Matches any group of characters.

For example, searching for comp* finds documents containing any word starting with the letters comp, such as computer, company, or comptroller.

One space (and nothing else)

All documents in the collection or category

To generate a list of all documents in the entire collection or category, simply use a single space as the query syntax.


Using Query Operators

To use query operators, enter the operators in the text box in the Search page. For more information on the operators, see these sections:

These sections cover the main query operators recognized by iPlanet Compass Server.


The Query Operators

The following reference describes each operator and provides examples of how to use the operator. The operators are listed in alphabetical order.

Operator Description Example
AND
<AND>

spaces
Adds mandatory criteria to the search. apples AND oranges
apples oranges

Finds documents containing both apples and oranges anywhere in the document in any order.

Ignores documents containing only one of the two words.

<CONTAINS>

Finds documents containing the specified words in a document field.

<CONTAINS> works on whole words only, while <SUBSTRING> operates on any set of characters.

Title <CONTAINS> Product Specification

Finds documents containing Product Specification in the title.

<ENDS> Finds documents where a document field ends with a certain string of characters. Title <ENDS> draft

Finds documents with titles ending in draft.

equals (=) Finds documents where a document field matches a specific value. Created = 6-30-96

Finds documents created on June 30, 1996.

greater than (>) Finds documents where a document field is greater than a specific value. Created > 6-30-96

Finds documents created after June 30, 1996.

greater than or equal to (>=) Finds documents where a document field is greater than or equal to a specific value. Created >= 6-30-96

Finds documents created on or after June 30, 1996.

less than (<) Finds documents where a document field is less than a specific value. Created < 6-30-96

Finds documents created before June 30, 1996.

less than or equal to (<=) Finds documents where a document field is less than or equal to a specific value. Created <= 6-30-96

Finds documents created on or before June 30, 1996.

<MATCHES>

Finds documents where a document field contains a specified pattern of characters.

Question mark (?) characters match any single character. Asterisks (*) match any number of characters.

Title <MATCHES> *comp*

Finds documents with titles containing words such as company or accomplish that include the pattern comp.

Keywords <MATCHES> ball????

Finds documents with keywords containing words such as ballpark, ballroom, balladry, and ballyhoo.

<NEAR>

Finds documents in which specified words are within 1000 words of each other. The closer the words appear to each other, the higher the relevance score assigned to the document.

iPlanet <NEAR> innovation

Finds documents containing both the words iPlanet and innovation, with no more than 1000 words between them and assigns greater relevance to those where the two words are closer to each other.

<NEAR/n>

Finds documents in which words are within n words of each other.

The value of n must be between 1 and 1,024 (do not type the comma).

All documents within the specified proximity are assigned equal relevance.

buy <NEAR/3> high

Finds documents containing the phrases buy low and sell high because there are no more than three words between buy and sell. Would not find buy at the market high, sell at the low.

NOT
<NOT>

(modifies other operators)
Finds documents that do not contain a specific word or phrase.

NOTE: Use <NOT> to modify the <OR> operator or the <AND> operator.

surf <AND> <NOT> beach

Finds documents containing the word surf but not the word beach.

OR
<OR>
Adds optional criteria to the search. apples <OR> oranges

Finds documents containing either apples or oranges.

<PHRASE>

Links individual words together as phrases.

iPlanet Compass Server treats multiple words enclosed by quotation marks as phrases. Thus, apples <PHRASE> and <PHRASE> oranges is treated the same as apples and oranges.

apples <PHRASE> and <PHRASE> oranges

Finds documents containing the phrase apples and oranges.

(Because it is part of a phrase, the word and is treated as a word to be searched for rather than an operator.)

Ignores documents where the words apples, and, oranges do not appear together as a phrase.

<STARTS> Finds documents where a document field starts with a certain string of characters. Title <STARTS> Corporate

Finds documents with titles starting with Corporate.

<STEM> Finds documents that include variations of the specified word, such as plurals, past tenses, and so on.

Note: iPlanet Compass Server assumes stem as a default. You do not have to actually enter stem in the search box.

<STEM> surf

Finds documents that contain any variant of surf, such as surfs, surfing, and surfboard.

<SUBSTRING>

Finds documents where any part of the specified document field contains the specified substring.

<SUBSTRING> works on any text string, while <CONTAINS> operates only on whole words.

Title <SUBSTRING> scape

Finds any documents whose title fields contain the string of characters net, such as in the words iPlanet or internet.

<WILDCARD>

Finds documents that contain strings matching a wildcard pattern.

Wildcards are special characters that match one or more other characters.

See Wildcard Characters.

<WORD> Finds documents that contain the exact word specified. <WORD> soft

Finds documents that contain the word soft without also finding documents that contain similar words such as software or softball


Document Fields

iPlanet Compass Server maintains an index of documents. The index contains an entry for each document. Each index entry contains one or more fields such as Title, Author, and URL. Queries can be limited to specific document fields, and documents are only found if they match your criteria in the specified fields.

For example, if you simply search for Einstein, you will find all documents that have the word Einstein in any one of the Title, Author, or Keywords fields. This will include documents about Einstein, documents that make reference to Einstein, and documents written by Einstein. But if you specify Author = "Albert Einstein," you will only find documents written by Albert Einstein.

By default, the index fields that you can search are:

(Your administrator may choose to create additional fields, or remove some of the default fields.)

For example, to search for documents that have been modified since July 14, 1997, you would enter Last-Modified = 7/14/97.

You can use wildcards and multiple operators in combination to further refine field-specific searches.


Searching by Date

When searching by date:


Determining Which Operators to Use

Use the following reference to help determine which operators you can use.

Type of Search Valid Operators Examples
Finding documents by date or by numeric value
  • is equal to (=)
  • greater than (>)
  • greater than or equal to (>=)
  • less than (<)
  • less than or equal to (<=)
  • DATE >= 06-30-96

    Finds documents created on or after June 30, 1996.

    Finding words, character strings, or phrases in document fields
  • <STARTS>
  • <CONTAINS>
  • <ENDS>
  • is equal to (=)
  • <MATCHES>
  • <SUBSTRING>
  • Title <STARTS> Help

    Finds documents with titles that start with help.

    Finding combinations of words
  • AND
  • OR
  • <NEAR>
  • <NEAR/n>
  • <PHRASE>
  • <STEM>
  • <WILDCARD>
  • <WORD>
  • specifications AND review

    Finds documents that contain both specifications and review.


    © Copyright © 2001 Sun Microsystems, Inc. Some preexisting portions Copyright © 2001 Netscape Communications Corp. All rights reserved.