Promotions
           

Home ] Products ] Services ] Reputable Sources ] Development Partners ] Defining Affordable ] Promotions ] Doing Business ] Business-Class ] Search ] Feedback ] FAQ ]

 

Boolean operators

You can use the Boolean operators AND, OR, and NOT in your searches.

When you use the NEAR operator in a query, a document matches the query if the words are within 50 words of each other in the document. The closer together the words are, the higher the rank that is assigned to the document in the result set. If the words are more than 50 words apart, they are not considered near enough, and the document is assigned a rank of zero. The NEAR operator can be applied only to words or phrases.

In content queries, use the NOT operator only after the AND operator. Use the NOT operator only to exclude documents that match a previous content restriction. For property-value queries, the NOT operator can be used apart from the AND operator.

The following table explains the Boolean operators and their associated symbols.

Operator Long form Short form
AND AND &
OR OR |
NOT AND NOT &!
NEAR NEAR Near, ~

The following table shows some examples of the use of Boolean operators:

To search for Long form Short form Result
Two terms in the same document red and dog red & dog Documents with both the words "red" and "dog"
Either of two terms in a document red or dog red | dog Documents with the words "red" or "dog"
One term without a second term red and not dog red & ! dog Documents with the word "red" but not "dog"
Documents not matching a property value not {prop name=size} = 100 !@size = 100 Documents that are not 100 bytes
Two terms that are close together in the same document red near dog red ~ dog Documents with the word "red" near the word "dog"
Either of two terms and not two other terms if they are close together red or dog and not (black near cat) red | dog &! (black~cat) Documents with the word "red" or "dog" and not the words "black" and "cat" if they are within 50 words of each other

 Note

Order of precedence rules

Boolean operators are evaluated in the following order:

  1. NOT
  2. AND or NEAR
  3. OR

After precedence rules are applied, operators are processed left to right. You can use parentheses (( )) to override the normal precedence. For example, the first three queries are equivalent, but the fourth is not:

a AND b OR c

c OR a AND b

c OR (a AND b)

(c OR a) AND b

In the fourth query, the OR operator is evaluated first because the expression is enclosed in parentheses.


Contact Information

Telephone
    +1 (866) Logitree (564-4873) Toll-free, USA and Canada
    +1 (949) 240-3570
Fax
     +1 (949) 240-3570
Mailing Address
     PO Box 3376 Dana Point, CA 92629-8376
E-mail
    Sales: sales@logitree.com

Please note that if you do not have a default e-mail client configured on the system you are using, you will not be able to send e-mail to this address by clicking on it.  Instead, you can copy and paste the address into your e-mail client (web-based or otherwise).  If you have no e-mail capabilities whatsoever, you can use this form (not secure) to request information or provide feedback. 


©1997-2012, Logitree Inc.