Phrases and Boolean Logic

Boolean search commands have been used by professionals for searching through traditional databases for years. These commands help narrow the results to just the information you are looking for. Although these commands are very powerful they can can be confusing for the uninitiated. Many search tools support a stripped down version of this logic. The table below provides the basic searching logic and the rest of the page discusses the details of boolean logic.

Basic Searching Logic
word word may exist in document
+word word must exist in document
-word word must not exist in document
"word1 word2" exact phrase may exist in document

OR

The Boolean OR command is used in order to allow any of the specified search terms to be present on the web pages listed in results. It can also be described as a Match Any search. You use the command like this:

ireland OR eire

All the major search engines support OR, with the following exceptions:

Of these exceptions, only Google entirely prevents an OR search. That's because at the other exceptions, they will perform an OR search by default. Thus, there's no need to explicitly specify an OR command when using them.

In general, most major search engines default to an OR search, though they will tend to rank pages containing all terms first. See the Match Any section of the Power Searching For Anyone page for a list of services that default to OR.

AND

The Boolean AND command is used in order to require that all search terms be present on the web pages listed in results. It can also be described as a Match All search. You use the command like this:

clinton AND dole

All the major search engines support AND, with the following exceptions:

All the major search engines, including those above, also provide AND functionality via the + symbol. The only exception to this is LookSmart. See Search Engine Math page for more information about using the + symbol.

Several search engines will perform an AND search by default. See the Match All section of the Power Searching For Anyone page for a list of these.

NOT

The Boolean NOT command is used in order to require that a particular search term NOT be present on web pages listed in results. It can also be described as an Exclude search. You use the command like this:

clinton NOT dole

All the major search engines support NOT, with the following exceptions:

At these search engines, you must use the command AND NOT, rather than NOT:

All major search engines, including those above, also provide NOT functionality via the - symbol. The only exception are Google and LookSmart. See Search Engine Math page for more information about using the - symbol.

NEAR

The NEAR command is used in order to specify how close terms should appear to each other. You use the command like this:

moon NEAR river

The search engines below support the NEAR command. The exact distance between terms is also shown, as this varies by service:

At Lycos and WebCrawler, you can also override the default setting and specify exactly the distance you desire by using the NEAR/# command. For example, here's how you would indicate that the terms must be within 10 words of each other:

moon NEAR/10 river

Lycos also supports a range of other proximity commands. See the service's help pages for more information.

Please consider whether you really need to control proximity within your searches. Most search engines will try to find the terms you indicate next to each other, or within close proximity to each other, by default. Also, all of the search engines support phrase searching through use of quotation marks. See Search Engine Math page for more information about phrase searching.

Nesting ( )

Nesting allows you to build complex queries. You nest queries using parentheses, like this:

impeachment AND (clinton OR johnson)

All the major search engines support nesting, with the following exceptions:

Be aware that the major search engines may process nested queries differently than each other.