1. CARMA Help Center
  2. Technical Knowledge

Boolean Operators Explained

Boolean operators are a helpful and powerful tool to refine search results. Here's a simple guide to help you understand and use them.

 

There are three basic Boolean operators: AND, OR, AND NOT.

AND: This operator requires both terms to be present in each item returned. If one term is missing, the item is not included in the resulting list. This narrows the search. For example, a search for "best restaurants" AND Lisbon would only include results that contain both terms, such as "Top 50 best restaurants in Lisbon."


OR: This operator includes either term (or both) in the results. This broadens the search. For example, a search for "best restaurants" OR "best bars" would include results that contain either term, such as "this is one of the best restaurants I've been to" or "one of the best bars in town."


AND NOT: This operator excludes the term from the search results. This can be useful for excluding irrelevant results, but be careful not to be too exclusive and eliminate potentially useful records. For example, a search for "best restaurants" AND NOT expensive would include results that mention best restaurants, but not expensive ones.

Tip: Phrases should be enclosed with speech marks. E.g.: "best restaurants" AND Lisbon versus best restaurants AND Lisbon

Parentheses ( ) can be used in Boolean search queries to group terms together and specify the order of operations. 

For example, consider the following search query:

("best restaurants" AND (Lisbon OR Porto)) AND NOT expensive

In this query, Lisbon and Porto are grouped together within parentheses and separated by the OR operator. This means that the search engine will first retrieve results that mention either Lisbon or Porto and then use the AND operator to combine those results with the rest of the query. Finally, it'll use the AND NOT to exclude any results mentioning expensive.

By using these operators, you can refine your searches to include only the most relevant results or broaden your search to include more possibilities.