Boolean Logic

Boolean Logic is the language or logical terminology recognised by most, but not all, search engines.

The terminalogy is a legacy of George Boole, a British mathematician who suggested that logical thought could be expressed as algebra. The language allows a user to control what the search engine does with the keywords entered into it... the Boolean Operators. By looking at some examples you can readily understand what these things do .

What are the main Boolean Operators?

The main Boolean operators are... OR - AND - NOT.

OR searches for documents that match either search term.

red OR green will find documents that contain references to either red or green or both. This search operator is fairly broad and could turn up many unnecessary pages.

AND searches for documents that match both terms.

red AND green will find only those documents that refer to both red and green. AND gives you much more focus than OR.

NOT searches for documents that do not contain (exclude) the specified term.

red OR green NOT blue will find those documents that contain a reference to red or to green but which do not mention blue.

Note: With most search engines you must use AND NOT to specify an exclusion.

Thus the example used above becomes...

red OR green AND NOT blue.

Other Operators

Some engines also add NEAR, ADJ, FAR and BEFORE.

NEAR searches for documents that contain the specified words close to one another. What constitutes "close to" varies from search engine to engine. It is usually from 10 to 25 words. With some engines you can specify proximity with the syntax NEAR/n, where n is the maximum number of words which can separate the two search terms.

red NEAR/10 green searches for documents in which red appears within 10 words of green.

ADJ searches for documents that contain the specified words right next to each other, in any order.

red ADJ green will find documents containing "red green" and "green red".

FAR searches for documents in which the search terms are 25 words or more apart from one another.

red FAR green searches for documents containing both red and green but separated by at least 25 words. Thus, this search will exclude any documents that contain the two words next to each other

BEFORE works just like AND, except that the terms must follow the specified order.

red BEFORE green looks for documents containing both terms, with red preceding green.