UA | COE | Rodgers Library
 
Refining Searches
Introduction To Boolean Logic
Narrowing Your Search
Expanding Your Search
Specific Exclusions
Demonstration
Exercise 1
Exercise 2
Exercise 3

Page 3
Expanding your search

We have seen how we can use AND to narrow our search. How can we broaden it? For example, what if we wanted to check not only hotels but motels as well? What if we wanted in check on "bed and breakfast" places, too? While informal English usage might suggest using "and," in Boolean logic, the operator we want is "OR."

Search for items with :

hotel OR motel OR "bed and breakfast"



Quick Quiz

What would we get if we asked for

hotel AND motel AND "bed and breakfast"

Answer: Since by definition hotels are different from motels and both of those are different from "bed and breakfast" places, it seems likely that the result of this search would be the empty set! Logically, no place could be all three of these, so using "AND" to join the three terms would give us no hits at all.

But suppose that for advertising reasons some establishments classified themselves as both "hotel" and "motel," some had both "motel" rooms or "hotel" rooms and "bed & breakfast" suites, and that some classified themselves as all three? What would the diagram look like then? The answer is here.


Going back to our "hotel OR motel…" example, once again we have pages from lodgings all over the world. We only want to look at lodgings in Atlanta, Georgia. So we have to combine the two previous examples.

Search for items with:

(hotel OR motel OR "bed and breakfast") AND Atlanta AND Georgia



Note that we used parentheses to keep all the "OR" terms together, separate from the "AND" terms. In practice, mixing ORs and ANDs together can produce confusing results. While it is possible to write a search statement like this without the parentheses, it is often confusing and the results may vary from one search engine to another. So it is safer to use them.


 

© 2002 University of Alabama
Last Modified : September 2007