A search query uses one or more phrases, optionally combined with operators. A phrase is made up of one or more words. If the phrase includes spaces, the entire phrase should be enclosed in double quotes (“ ”) to ensure the phrase is treated as a single unit.
Each word in the phrase can include the asterisk (*) wild-card character, which matches zero or more characters at the end of the word. You can only use the * character at the end of a word, never at the beginning.
You combine phrases with search operators to form a query as follows:
phrase operator phrase [operator phrase]...
A query must begin with a phrase; an operator cannot be the first word in a query. The brackets [ ] mean that you can combine operator/phrase pairs inside the query.
Operators and their effects are listed in the following table:
Operator | Selects |
AND | Topics containing all phrases connected by AND operators. If a phrase does not appear in quotes, any space between words in the phrase is assumed to represent an implicit AND; for example: | |
"Bees love Honey" | ||
This phrase finds any topic containing the phrase “Bees love Honey.” As another example: | ||
Bees love Honey | ||
This phrase finds any topic containing the three words “Bees,” “love,” and “Honey.” | ||
OR | Topics containing any phrase connected by OR operators; for example: | |
Bees or Honey | ||
This query displays topics containing either the word “Bees” or the word “Honey.” | ||
, | ||
NOT | Any topic that doesn't contain the phrase following NOT; for example: | |
Bees NOT Honey | ||
This query finds topics containing the word “Bees” but not the word “Honey.” NOT cannot be the first operator in a query. | ||
NEAR | Any topic in which one phrase appears within a certain number of words of a second phrase; for example: | |
Bees NEAR Honey | ||
This query finds any topic in which the word “Bees” appears within 8 words before or after the word “Honey.” The default value for NEAR is 8, but authors can change this default at build time, and users can enter a new NEAR value in the Search Hints dialog box. |
Summary: Quotes in Queries
When search text appears in quotes, Viewer searches for the exact text appearing in quotes. For example, the following query finds any topic in which the text “Bees love Honey” appears:
"Bees love Honey"
Summary: Parentheses in Queries
When part of a search query appears in parentheses, Viewer evaluates the search expression in the parentheses before it evaluates the rest of the query. If more than one part of a query appears in the parentheses, Viewer evaluates the parts in parentheses from left to right.
For example, the following query finds any topics containing the phrase “Bees love Honey.” It also finds any topics containing both the word “Bees” and the word “Honey”:
("Bees love Honey") OR (Bees AND Honey)
Viewer first evaluates the phrase “Bees love Honey.” It finds any topics where this exact text string appears. It then evaluates the next expression in parentheses:
Bees AND Honey
This expression finds any topics containing both the word “Bees” and the word “Honey.”
Since this query uses the OR operator, Viewer searches for topics containing either of these text combinations.
Summary: Stop Words
Stop words within a phrase are ignored. Stop words are common words such as “the” and “an” that you don't want included in the Search index file. Viewer looks for stop words in the stop-word list, a file containing stop words. When you create a stop-word file, you give it the name of the title followed by the suffix .STP. You can edit the file GENERIC.STP, which contains a default stop-word list for Viewer, and then save it with the appropriate filename for your title.
The words AND, OR, NOT, and NEAR are treated as operators unless they appear within quotes. If they appear within quotes and they are contained in the .STP file, they are treated as stop words.