Examples of Boolean Expressions

This article gives you some examples of Boolean expressions to help with your search setups.

Nirain Patel avatar
Written by Nirain Patel
Updated over a week ago

Learning Outcomes

  • You will gain a better grasp of Boolean expressions and how they work.

  • You will learn different structures for Boolean expressions that have more than one operator.


Below are some examples of how to use different operators when writing Boolean expressions: 

1. Some simple Boolean expressions

  • (apple AND iphone) 

  • (apple OR iPhone) AND NOT mobile 

  • IN_URL (trump OR melania) AND NOT donald 

  • ("apple juice" OR "orange juice") AND NOT phone

  • apple AND (iphone OR #iphone) AND NOT fruit   

2. A Boolean expression with Keywords Blacklist + Language + Location

(#skiholiday OR #beachholiday OR #skiingholiday OR #beachholidays) AND NOT (win OR competition OR prize OR giveaway) AND LANG "en" AND LOCATION ("GB" OR "US" OR "ES")

3. A Boolean expression with Site Blacklist + Language

((#bitcoin OR #cryptobear) AND (crypto OR cryptocurrency OR #crypto OR #cryptocurrency) AND (bubble OR #bubble OR "market bubble" OR "bear market" OR bearmarket OR "too risky" OR "too much risk" OR uproven OR unpredictible OR doubter OR skeptic OR #skeptic OR skeptical OR "too volatile" OR "too much volatility" OR "bound to fail" OR "end in failure" OR pessimistic OR #pessimistic OR pessimism OR bearish OR #bearish OR bullish OR #bullish OR optimism OR #optimism OR bulls OR "i'm a bull" OR confident OR "i'm convinced" OR "a convert" OR believer OR "fully invested" OR #believer OR "future of money" OR #futureofmoney)) AND NOT SITE (groups.google.com) AND LANG "en"  

4. A Boolean expression with Authors Blacklist + Language

(apple OR iPhone OR #iphone) AND NOT BY_TWITTER (@espncfb OR @nfl OR @espnnfl OR @nflfantasy OR @espnfantasy) AND LANG "en"

5. A Boolean expression with Location + Language + Media type

(cheese OR cheddar OR gruyere OR "blue cheese") AND (grapes OR jam OR fruit) AND LOCATION "us" AND (LANG "en" OR LANG "es") AND MEDIA images   

6. A Boolean expression with Grouped Keywords + Near Operators

((Heineken) AND "van beemen") OR ("Heineken in Africa" OR "Olivier van beemen" OR "Heineken africa"~5 OR "Heineken african"~5 OR "Heineken book"~5 OR "Multinational unleashed") 

7. A Boolean expression with Grouped Keywords + Retweet/RT Blacklist + X Author Blacklist

(Soccer OR #soccer OR "New England Revolution" OR NERevs OR #NERevs OR NERevolution OR "Chelsea FC" OR "Chelsea F.C." OR "Chelsea Football Club" OR ChelseaFC OR #ChelseaFC OR "Premier League" OR #PremierLeague) AND NOT RT AND NOT (BY_TWITTER @nerevolution OR @BostonDotCom OR @ESPNStatsInfo OR @MenswearDeals OR @BostonGlobe OR @ESPNPR OR @NESN OR @SneakerShouts OR @WTNH OR @NESN)  

8. A Boolean expression with Location + Blacklist Author Retweets

(building OR buildings OR warehouse OR factory) AND (fire OR flood OR flooding OR flooded OR explosion) AND LOCATION ("GB" OR "US" OR "ES") AND NOT RT_OF (@InsuranceAge OR @InsuranceTimes_) 

9. A Boolean expression with Blacklist + Location

((“highways england" OR highwaysengland OR "highways agency" OR highwaysagency OR highwaysseast OR highwaysswest OR highwayseast OR highwaysemids OR highwayswmids OR highwaysnwest OR highwaysneast OR highwaysyorks OR "the A6127" OR "the M6 Toll" OR "the A167" OR "the A194" OR "the A308" OR "the A329" OR "the A404" OR "the A601" OR "the A5" OR "the A627" OR "the A635" OR "the A823" OR "the A423" OR "the A38" OR "the A48" OR "the A500" OR "the A57" OR "the A58" OR "the A64" OR "the A66" OR "the A74" OR "the A20") OR (motorway AND DEVON OR CORNWALL OR EXETER OR HONITON OR "BERE REGIS" OR DAWLISH OR EXMOUTH OR SIDMOUTH OR TIVERTON OR BARNSTAPLE OR WELLINGTON OR BOURNEMOUTH OR TORQUAY OR BODMIN OR PENZANCE OR LAUNCESTON OR OKEHAMPTON OR PLYMOUTH OR TAVISTOCK OR DORCHESTER OR LYNDHURT)) AND NOT (career OR vacancy) AND LOCATION "GB" 

10. A Boolean expression with Near Operators

(("academic pay"~6 OR "academic salary"~6 OR "academic salaries"~6 OR "academic wage"~6 OR "academic wages"~6 OR "academic living wage"~6 OR "academic wage war"~6 OR "academic income"~6 OR "academic payment"~6 OR "academic payments"~6 OR "academic remuneration"~6 OR "academic paid"~6 OR "academics pay"~6 OR "academics salary"~6 OR "academics salaries"~6 OR "academics wage"~6 OR "academics wages"~6 OR "academics living wage"~6 OR "academics wage war"~6 OR "academics income"~6 OR "academics payment"~6 OR "academics payments"~6 OR "academics remuneration"~6 OR "academics paid"~6) OR (professor OR lecturer OR "university staff" OR gta OR "graduate teaching assistant" OR vice-chancellor OR "vice chancellor" OR vice-principal OR "vice principal" OR academics OR university AND tutor OR university AND tutors OR school AND tutor OR school AND tutors OR teachers) AND (Pay OR salary OR salaries OR wage OR wages OR "living wage" OR "wage war" OR income OR payment OR payments OR remuneration OR paid OR "pay gap")) 

 

11. A Boolean expression with Keywords Blacklist and Location 


(((#getlivinglondon OR @getliving OR @GetLivingLDN OR "Get Living") AND ("Elephant & Castle" OR "Elephant and Castle" OR #elephantcastle OR #elephantandcastle OR development OR "development plan" OR #development OR "affordable housing" OR #affordablehousing OR "new homes" OR #newhomes OR "build to rent" OR #Buildtorent OR housing OR #housing OR rent OR #rent)) OR (("Elephant & Castle" OR "Elephant and Castle" OR #elephantcastle OR #elephantandcastle) AND (development OR "development plan" OR #development OR "affordable housing" OR #affordablehousing OR "new homes" OR #newhomes OR "build to rent" OR #Buildtorent OR housing OR #housing OR rent OR #rent))) AND NOT (#eastvillageldn OR "east village london" OR "east village ldn" OR #myE20) AND LOCATION ("GB”)  

12. A Boolean expression with the Pinterest Operator

(("vegan" OR #vegan OR "plant-based" OR "plantbased" OR #plantbased OR "vegans") AND ("taco" OR "tacos" OR #taco OR #tacos OR "burger" OR "burgers" OR #burger OR #burgers OR "restaurants" OR "restaurant" OR #restauraunt OR #restaurants OR "vancouver" OR #vancouver) OR PINTEREST (vegan AND taco OR "plant-based" OR plantbased AND burger AND vancouver OR vegan AND vancouver OR "vegan restaurant" AND vancouver))

13. A Boolean expression in Russian 


((собаке OR собачке OR собакам OR собачкам OR псу OR пёсику OR псам ORпесикам OR песику OR щенку OR щеночку OR щенкам OR псине) AND ("нравится ее" OR "нравится его" OR "нравится их" OR "нравилась ее") OR (собака OR собаки ORсобачка OR пес OR пёс OR песик OR пёсик OR щенок OR щеночек OR псина) AND("любит свою" OR "любят свои" OR "любила свою" OR "любила свои" OR "любил свою" OR "любил свой" OR "любили свои") OR (собаке OR собачке OR собакам ORсобачкам OR псу OR пёсику OR псам OR песикам OR песику OR щенку OR щеночку OR щенкам OR псине) AND ("нужна ее" OR "нужна её" OR "нужен ее" OR "нужен её" OR "нужны их") OR (собака OR собачка OR пес OR пёс OR песик OR пёсик OR щенок OR щеночек OR псина) AND ("ненавидит свою" OR "ненавидят своих" OR "ненавидят свою" OR "не любят свои" OR "не любят своих" OR "не любит свою" OR "не любит свою") OR (собака OR собачка OR пес OR пёс OR песик OR пёсик OR щенок ORщеночек OR псина) AND ("хочет свою" OR "хотят свою" OR "хотят свои") OR (дайте OR дай OR дала OR дал) AND ("собаке ее" OR "собакам их" OR "псу его" OR "псам их") AND NOT ("насилие" OR "жестокость" OR "беззащитный" OR "приют для собак" OR "приют" OR "бездомные собаки" OR "мошенничество" OR "приютить" OR "порно" OR "фетиш" OR "#фетиш" OR "пожертвование" OR "собака в подарок" OR "собака подарок" OR "кошка в подарок" OR "кошка подарок" OR "подарить собаку" OR"подарить кошку" OR "щенок в подарок" OR "подарить щенка" OR "подарить кошку" OR "кошачий день сурка")) AND LOCATION ("RU") 

Did this answer your question?