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 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 18,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 nearly 41,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 1222 items.

Library catalog search -- Advanced Search screen
Boolean AND search in the library's catalog

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

Library catalog search -- Advanced Search screen
Boolean AND search in the library's catalog using subject keyword

This search results in 645 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. 

Boolean AND Search Strategy Venn Diagram Showing the Boolean AND Search Strategy
   
Figure 1: Subject search for education AND computers

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.

Try the search in the Library's catalog.

OR is used to broaden search results. For example, a keyword search in the the Library's catalog for information on film yields over 8900 items. A keyword search on cinema yields over 1700 items. Since not all material descriptions will include the words film, films, filming and cinema, to retrieve all materials described with any of these words, use the OR search strategy to find materials matching any of these keywords.

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 all 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.

Boolean OR Search Strategy Venn Diagram Showing the Boolean Or Search Strategy
 
Figure 2: Keyword search for
film(s)
OR cinema

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.

Library catalog search -- Advanced Search screen
Boolean AND search in the library's catalog using subject keyword
Try the search in the Library's catalog.


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.

Boolean NOT Search Strategy Venn Diagram Showing the Boolean NOT Search Strategy
 
Figure 3: Keyword search for (english literature NOT american literature)

The circle to the left represents the more than 3500 items in the UNF Library on English Literature. The circle to the right represents the more than 4200 items on 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 a little over 2900 items, considerably fewer items than the more than 3500 that were listed for English Literature alone. Note in the following example that keyword 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 using subjects

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 "with all of the words" input box, the OR search is triggered by typing information into the "with at least one of the words" input box, and the NOT search is triggered by typing information into the "without the words" box.

Google advanced search screen

Using Boolean logic, a searcher can more precisely describe exactly what information is needed. While some search systems tout "natural language" searching, behind the scenes, they are actually building a Boolean query to locate information in the database. Once a researcher learns how Boolean logic operates, the task of locating information in a database will become less tedious.

Page updated 09/07.

counter        | About LIS1001 | Site Map | Contact Jim | ©2007 Jim Alderman |