Print This Page

Searching this site the Boolean way

Use Boole's logic to search this web site

 


 

How to search the Boolean way

Boole invented the algebra we now use to describe logic to a computer. Boole's logic lets a program make choices, for example (< is the symbol for ‘less than’):

IF CURRENT-BALANCE < 0 THEN
   DISPLAY 'O/D'
ELSE
  DISPLAY 'ACCOUNT IN CREDIT'
END-IF.

Your bank does this (or something similar but more complex) for each line on your bank statement!

You can use Boole's logic in searching, so if you search this site for  conference and logic , you'll get just those pages which contain the word ‘conference’ AND the word ‘logic’ or both — but NOT any page that contains only one of the words without the other.

Searching for  conference or logic will get you pages that contain either word. Boolean logic also lets you negate a term, so searching for  conference not logic will return all the pages mentioning conferences but not if they also contain the word ‘logic’.

Google's search works differently: it lets you prefix a term with a hyphen to force it to be excluded (like NOT), so in a Google search you could type  conference -logic , but there is no way to force a word to be included (there used to be: the plus sign, but they don't support that any more). Google's search is wider-ranging and more loosely-defined: a strict Boolean search is much more accurate and rigorous provided you know exactly the words you want used or not used.

The search engine we use here (Swish-E) also lets you group words in parentheses, so you can be more specific (phrases using this technique also need to be in single quotes to ensure the phrase gets interpreted as a single unit):

cork and lincoln 'not (conference and logic)'

It also adds a extension called NEAR (followed by a number) so that you can search for terms which come close together, like  cork near5 lincoln  which would return pages where the words ‘cork’ and ‘lincoln’ occurred within five words of each other.

Thank you to Rachael Flynn (BIS 2004) for the COBOL statement.