Most library database searching. is based on the principles of Boolean logic. Boolean logic refers to the logical relationship among search terms, and is named for the British mathematician George Boole.
Boolean logic consists of three logical operators:Each operator can be visually described by using Venn diagrams, as shown below.
ORQuery: I would like information about college.
college OR university
- In this search, we will retrieve records in which AT LEAST ONE of the search terms is present.
- This is illustrated by:
- the shaded circle with the word college representing all the records that contain the word "college"
- the shaded circle with the word university representing all the records that contain the word "university"
- the shaded overlap area representing all the records that contain both "college" and "university"
OR logic is most commonly used to search for synonymous terms or concepts.
Here is an example of how OR logic works:
Search terms Results college 17,320,770 university 33,685,205 college OR university 33,702,660
OR logic collates the results to retrieve all the unique records containing one term, the other, or both.
The more terms or concepts we combine in a search with OR logic, the more records we will retrieve.
Search terms Results college 17,320,770 university 33,685,205 college OR university 33,702,660 college OR university OR campus 33,703,082
ANDQuery: I'm interested in the relationship between poverty and crime.
poverty AND crime
- In this search, we retrieve records in which BOTH of the search terms are present
- This is illustrated by the shaded area overlapping the two circles representing all the records that contain both the word "poverty" and the word "crime"
- Notice how we do not retrieve any records with only "poverty" or only "crime"
Here is an example of how AND logic works:
Search terms Results poverty 783,447 crime 2,962,165 poverty AND crime 1,677
The more terms or concepts we combine in a search with AND logic, the fewer records we will retrieve.
Search terms Results poverty 783,447 crime 2,962,165 poverty AND crime 1,677 poverty AND crime AND gender 76
A few Internet search engines make use of the proximity operator NEAR. A proximity operator determines the closeness of terms within a source document. NEAR is a restrictive AND. The closeness of the search terms is determined by the particular search engine. For example:
- NEAR in AltaVista (Power Search) is 10 words
- NEAR in Lycos (Lycos Pro) is 25 words
NOTQuery: I want to see information about cats, but I want to avoid seeing anything about dogs.
cats NOT dogs
- In this search, we retrieve records in which ONLY ONE of the terms is present
- This is illustrated by the shaded area with the word cats representing all the records containing the word "cats"
- No records are retrieved in which the word "dogs" appears, even if the word "cats" appears there too
Here is an example of how NOT logic works:
Search terms Results cats 3,651,252 dogs 4,556,515 cats NOT dogs 81,497
NOT logic excludes records from your search results. Be careful when you use NOT: the term you do want may be present in an important way in documents that also contain the word you wish to avoid.
Query: I need information about cats.
Boolean logic: ORQuery: I'm interested in dyslexia in adults.
Search: cats OR felines
Boolean logic: ANDQuery: I'm interested in radiation, but not nuclear radiation.
Search: dyslexia AND adults
Boolean logic: NOTQuery: I want to learn about cat behavior.
Search: radiation NOT nuclear
Boolean logic: OR, AND Search: (cats OR felines) AND behavior
Note: Use of parentheses in this search is known as forcing the order of processing. In this case, we surround the OR words with parentheses so that the search engine will first process this part of the search. Next, the search engine with combine this result with the last part of the search. Using this method, we are assured that the OR terms are kept together as a logical unit.