Library Front AngleGeorge Boole

Boolean Logic/Boolean Searching

One of the major advantages of using computers to search large databases for information is the ability to use the Boolean operators AND, OR, and NOT to describe the logic of your search. Boolean logic is based on the work of British mathematician George Boole, whose work in algebra established the logical principles of set theory. Even Google uses Boolean logic in its Advanced Search page.
Most search systems, Google included, assume that searchers will plug in all words that are needed for the successful completion of a search. This is an AND search. In other words, if a searcher plugs in the words healthcare, elderly, and government, systems like Google, including many library and research database systems, automatically assume that all three words must be present in each of the search results. This may not always be the intent of the researcher. For those searchers who want more control over the precision of the searches, most databases and library catalogs and Internet search engines accommodate Boolean searching.
To illustrate how Boolean searching works, the following examples draw on results from the UNF Library's catalog. The following graphic representations may help you to understand the application of the Boolean operators. Sample searches were conducted in the library's catalog, but the principles used apply as well to other online databases.

AND

AND is used to narrow the results of a database search. For example, if you were looking through the Library's catalog for resources about computers, you would find over 21,000 items listed. Rather than try to browse through so many items, you could choose a more specific subset of resources on computers, such as only those computer materials that also deal with education. A keyword search for materials on education results in over 47,000 items. The AND operator allows the user to compare all the materials on computers with all the materials on education AND select only those that deal with both keywords. A search of the Library's catalog for the keywords "computers" and "education" results in a listing of over 1700 items.

Boolean AND search in the library's catalog: COMPUTERS AND EDUCATION

Boolean AND

An even better way to pare down the search results is to search for the SUBJECTS computers and education.

Boolean AND Search limited to Subjects: COMPUTERS AND EDUCATION

Boolean AND Subjects

This search results in just over 700 items, a reduction of about half our original search results. If you think in terms of the old card catalog, this search is the equivalent of opening the drawer containing catalog cards for books and other materials on computers, looking at the subject headings at the bottom of the cards, and writing down only those items that also have education listed as an additional subject heading. 
Figure 1: Subject search for COMPUTERS AND EDUCATION

Boolean AND graphic

Figure 1 provides a graphic representation of how the AND search works. The circle on the left represents the set of all books in the library dealing with education. The circle on the right represents all books in the library dealing with computers. The intersection, or shared region of the two circles (shown in blue shading), represents the books in the library that deal both with computers AND with education.

OR

OR is used to broaden search results. For example, a keyword search in the the Library's catalog for information on film yields over 11,000 items. A keyword search on cinema yields over 2300 items. Since not all material descriptions will include the words film and cinema, to retrieve all materials described with either of these words, use the OR search strategy. The result is a listing of more than 12,000 items.
Some databases allow users to "truncate" or cut short words that have multiple endings. The Library's current catalog system automatically searches plural forms of words, but it doesn't allow the use of truncation or wildcards. Because of this, the Boolean search strategy opens up a search of the catalog to include other forms of a word. The OR search strategy allows a searcher to look for materials that cover any of the keywords entered, such as film or films or filming or cinema, etc. This particular OR search has no card catalog equivalent since keyword searching was not an option in the printed card catalog. If a researcher were searching the subject catalog, however, and decided to look for anything on English Literature and for anything on American Literature, the researcher would have to search through all the drawers on both subjects. This search would be equivalent to an OR search by subject in the Library's catalog.
Figure 2: Keyword search for FILM OR CINEMA

Boolean OR graphic

Figure 2 provides a graphic representation of the OR search. The circle on the left represents the set of all materials in the UNF Library dealing with the singular or plural form of the word film. In this case, because a keyword search was used, the words film or films could be part of the subject headings, titles, authors names, or any other descriptive information included in the item's cataloging. The circle on the right represents the set of all UNF Library materials dealing with cinema. Since the OR logic creates a union of the two sets, the search results are larger than the largest of the two searches. The blue shading reveals the search result, which includes everything in both sets, including those items held in common between the two.

Boolean OR search in the library's catalog: FILM OR CINEMA

Boolean OR

NOT

NOT provides a further means for narrowing a search by eliminating items that are described using certain keywords. A search performed with NOT would look as illustrated in Figure 3.
Figure 3: Keyword phrase search for "ENGLISH LITERATURE" not "AMERICAN LITERATURE"

Boolean NOT

The circle to the left represents the more than 3800 items in the UNF Library on English Literature. The circle to the right represents the more than 4500 items on American Literature. (Note: Both topics were searched as phrases: "english literature"  "american literature") If a researcher finds it desirable to look only at those materials that deal solely with English Literature, the NOT combination excludes from the final search result materials on American Literature. The search results in over 3100 items, considerably fewer items than the more than 3800 that were listed for English Literature alone. Note in the following example that keyword phrase searching is done using quotation marks around the two word phrases. The quotation marks force the catalog (and most other databases) to match the two words only if they appear together as a phrase. A search using the NOT operator in the Library's catalog would be formatted as follows.

Boolean NOT search in the library's catalog: "ENGLISH LITERATURE" NOT "AMERICAN LITERATURE"

Boolean NOT

Google and Boolean Logic

Boolean searching is one of the most frequently used means for querying a database for meaningful information. It is even used by Web search engines like Google. When you type a string of words in Google you are actually doing a Boolean AND search. By default, Google looks for all the terms that you include in your search. You can also use the NOT and OR logic in Google by using the Advanced Search screen. In Google's Advanced Search screen, the AND search is triggered by typing information into the "all these words" input box, the OR search is triggered by typing information into the "one or more of these words" input boxes, and the NOT search is triggered by typing information into the "any of these unwanted words" box.

Google Advanced Search

Updated 1/2012.