SEARCHING FOR INFORMATION


Refining a search query using operators
Search operators are words and characters that instruct Notes to search for words, fields, dates and numbers in specific combinations. In Notes, search operators work the same way they do in most Web search engines--that is, they are based on Boolean logic--with some very powerful enhancements. For example, you can create a search for two words that appear in the same document, and specify how close they should be to one another, what field they must be in, and their exact case. In addition, you can specify that one word should be judged as more important than the other, so documents containing the first word appear closer to the top of the list of search results. Using wildcards, you can also search for word fragments.

Operators are reserved words in Notes. If you want to search for an operator as you would normal text, for example in a phrase such as "Gene and Joan," you must put the phrase in quotes.

To use an operator in your search, enter it into the text entry box in the Search bar, using a format shown in the table below.
OperatorDescription and examplesDoes it work searching a view from Notes?Does it work searching a domain from Notes?Does it work searching a view or domain from the Web?
CONTAINS

contains

=

This tells Notes that the field before it must contain the text after it. There should be spaces between 'CONTAINS' and words surrounding it.

Example: '[Projectname] CONTAINS top secret' finds documents whose Projectname field contains the words 'top secret.'

YesYesNo
field fieldname

FIELD fieldname

[fieldname] (use square brackets)

These mean 'search this field.' You must specify the field to search by using its field name.

Example: Each of the following are equivalent ways to find documents whose Projectname field contains the phrase top secret:

  • FIELD Projectname CONTAINS top secret
  • field Projectname CONTAINS top secret
  • [Projectname] CONTAINS top secret
Note Notes stores file attachments in the $FILE field.
YesNoYes, in view searches only
( ) [parentheses]This determines the order in which Notes processes sections of your query. A part of the query enclosed in parentheses will be processed before parts outside the parentheses.

Example: '(FIELD Projectname CONTAINS top secret OR FIELD Title CONTAINS tuna) AND (Field body CONTAINS cat OR Field revdate > 01/01/2004)' will return documents whose Projectname field contains the words 'top secret' or whose title field contains the word 'tuna'; and either the body field contains the word cat or the revdate field contains a date greater than 01/01/2004.

YesNoYes
and

AND

&

These find documents containing all the conditions or words linked by AND.

Example: 'cat AND dog AND fish' finds documents containing all three of these words.

YesYes'&' doesn't work
or

OR

|

ACCRUE

, (comma)

These find documents containing either of the conditions or words and returns them ranked by number of appearances in the document.

Example: 'cat OR dog OR fish' finds documents containing at least one of these words.

Note ACCRUE works slightly better than OR when sorting results by relevance.

YesYesYes
NOT

not

!

These make the query negative.
  • You can put NOT between words: 'cat AND NOT dog' finds documents containing the word cat, but not if they also contain the word dog.
  • '(cat OR dog) AND NOT (fish OR frogs)' finds documents containing the word cat or dog, but not if they also contain the word fish or frog.
  • '(cat AND dog) AND NOT fish' finds documents containing the words cat and dog, but not if they also contain the word fish.
  • You can put NOT before any field name: 'NOT [Projectname] CONTAINS top secret' finds documents whose Projectname field does not contain the words 'top secret.'
  • You cannot put NOT after the math symbols =, <, >, <=, or >=; and before a date or number: For example, '[date1] = NOT 12/25/2002' is not an appropriate query.
YesYesYes
" "Placing double quotes around operators (like AND, OR, CONTAINS etc.) allows Notes to read them as normal words.

Example: "rock and roll" finds documents containing the phrase rock and roll.

YesYesYes
PARAGRAPH

paragraph

This finds documents in which the words surrounding PARAGRAPH are in the same paragraph, and ranks them by how close they are.

Example: 'car PARAGRAPH wheels' finds documents in which 'car' and 'wheels' appear in the same paragraph and ranks them by how close the words are within the paragraph.

Yes

(The database's full-text index needs to have been created with the "Index sentence and paragraph breaks" option selected. For more information, see Full-text index options.)

YesNo
SENTENCE

sentence

This finds documents in which the words surrounding SENTENCE are in the same sentence, and ranks them by how close they are.

Example: 'car SENTENCE wheels' finds documents in which 'car' and 'wheels' appear in the same sentence and ranks them by how close the words are within the sentence.

Yes

(The database's full-text index needs to have been created with the "Index sentence and paragraph breaks" option selected. For more information, see Full-text index options.)

YesNo
?This is a wildcard. It represents any single letter. It does not work with dates or numbers.

Example: '?one' finds documents containing bone, cone, done, gone (and any other four-letter words that end with 'one')

'???ck' finds documents containing stack, clock, stick, truck; rack, rick, rock

YesYesYes
*This is a wildcard. It represents any extension of letters. It does not work with dates or numbers.

Example: '*one' finds documents containing bone, cone, clone, crone, done, drone, gone, telephone (and any other words of any length that end with 'one')

Also, '*one*' finds documents containing bone, cone, clone, lonely, phoned, stoned, pardoned

YesYesYes
TERMWEIGHT

termweight

This gives importance, or "weight," to search words. You can use any value from 0 through 65537 to assign weight.

Example: 'TERMWEIGHT 25 photo or TERMWEIGHT 75 audio or TERMWEIGHT 50 video' finds documents containing at least one of the words. 'Audio' is most important, 'video' is next, and 'photo' is least important. Notes ranks results accordingly. You need an AND or OR between first TERMWEIGHT and subsequent ones.

YesYesNo
EXACTCASE

exactcase

This tells Notes to search for the exact case of the word following.

Example: 'exactcase Apple' finds documents containing 'Apple,' but not 'APPLE' or 'apple.'

Yes

(The database's full-text index needs to have been created with the "Enabled case sensitive searches" option selected. For more information, see Full-text index options.)

NoNo
= (equal)

< (less than)

> (greater than)

<= (less than or equal)

>= (greater than or equal)

These help you search for numbers or dates in numeric or date fields only.

Example: 'FIELD date1<12/25/98' finds documents whose 'date1' field contains any date before 12/25/98.

YesYesNo
- (hyphen)This tells Notes to find the hyphenated word pair. Example: 'full-text' finds documents containing "full-text."YesYesYes
Note Use the fieldname _CreationDate to find documents by the date they were created. For example, "[_CreationDate]=1/05/2001" finds documents created on January 5, 2001. Use the fieldname _RevisionDate to find documents by the day they were last modified. For example, "[_RevisionDate]=1/05/2001" finds documents that were last modified on January 5, 2001. These fields are contained in a document's header, not the document itself, and are therefore not in the list of fieldnames found in the Document properties dialog box.

Go to top

See Also