12
Booleans for Search College of Alameda [email protected] Copyright © 2010 Patrick McDermott “Have in mind though that even very advanced searchers, such as the members of the search group at Google, use these features less than 5% of the time. Basic simple search is often enough.”—Google Advanced Search Help

Booleans for Search College of Alameda [email protected] Copyright © 2010 Patrick McDermott “Have in mind though that even very advanced searchers,

Embed Size (px)

Citation preview

Page 1: Booleans for Search College of Alameda pmcdermott@peralta.edu Copyright © 2010 Patrick McDermott “Have in mind though that even very advanced searchers,

Booleans for Search

College of [email protected]

Copyright © 2010 Patrick McDermott

“Have in mind though that even very advanced searchers, such as the members of the search group at Google, use these features less than 5% of the time. Basic simple search is often enough.”—Google Advanced Search Help

Page 2: Booleans for Search College of Alameda pmcdermott@peralta.edu Copyright © 2010 Patrick McDermott “Have in mind though that even very advanced searchers,

Poor George

• Named After George Boole, 1847– “But what Good is it, George??”

• A.K.A. Propositional Calculus, Logical Algebra, Boolean Logic

• Binary: yes/no, on/off, true/false, 0/1• Two states: true and false

Choose one from Column A & one from Column B

Column A Column BBoolean AlgebraLogical CalculusPropositional LogicSymbolic

George Boole(1815-1864)

Page 3: Booleans for Search College of Alameda pmcdermott@peralta.edu Copyright © 2010 Patrick McDermott “Have in mind though that even very advanced searchers,

It’s Only Words…

The Algorithm• Inflections: plurals, verb tenses• Baseball = Earthquake Problem• Auto vs. Car: Synonyms• Not about Cannibals• “Exact Phrase”

“If it was so, it might be; and if it were so, it would be; but as it isn’t, it ain’t. That’s logic.”—Tweedledee, in Through the Looking Glass

Page 4: Booleans for Search College of Alameda pmcdermott@peralta.edu Copyright © 2010 Patrick McDermott “Have in mind though that even very advanced searchers,

Stop Words• Words that are too Common

– On virtually every webpage

• the and a this that, etc.• Prepositions• Lists Vary• Sometimes a common word is important

– The Algorithm, Of Mice and Men– Try “exact quote”

Page 5: Booleans for Search College of Alameda pmcdermott@peralta.edu Copyright © 2010 Patrick McDermott “Have in mind though that even very advanced searchers,

1 Rose (Windows), or 16 Roses (Unix)?

1. ROSE

2. ROSe

3. ROsE

4. ROse

5. RoSE

6. RoSe

7. RosE

8. Rose

9. rOSE

10. rOSe

11. rOsE

12. rOse

13. roSE

14. roSe

15. rosE

16. rose Pierre-Auguste Renoir (1841–1919)Les Roses dans un Vase, c. 1910–17

For filenames, Windows is Case Insensitive; Unix is Case Sensitive

Page 6: Booleans for Search College of Alameda pmcdermott@peralta.edu Copyright © 2010 Patrick McDermott “Have in mind though that even very advanced searchers,

Visualize Truth

3 Little Words

ANDORNOT

That’s It!

But:

Graduate Seminars Don’t cover it all!

Page 7: Booleans for Search College of Alameda pmcdermott@peralta.edu Copyright © 2010 Patrick McDermott “Have in mind though that even very advanced searchers,

AND vs. OR

AND(p,q,r,s,t,u)– true only when ALL are true– false if any one is false– More WordsFewer Pages

OR(p,q,r,s,t,u)– false only when ALL are false– true if any one is true– More WordsMore Pages

Or for MoreAnd

Page 8: Booleans for Search College of Alameda pmcdermott@peralta.edu Copyright © 2010 Patrick McDermott “Have in mind though that even very advanced searchers,

Google PeraltaAlamedaBerkeleyLaneyMerritt

AlamedaBerkeleyMerritt

AlamedaMerritt

AlamedaBerkeley

Alameda

Search Query:

alameda

Page 9: Booleans for Search College of Alameda pmcdermott@peralta.edu Copyright © 2010 Patrick McDermott “Have in mind though that even very advanced searchers,

Google PeraltaAlamedaBerkeleyLaneyMerritt

AlamedaBerkeleyMerritt

AlamedaMerritt

AlamedaBerkeley

Alameda

Search Query:

alameda berkeley

ALL must be True

AND

p q p AND q

true true truetrue false falsefalse true falsefalse false false

Truth Table Venn Diagram

Implied AND

Page 10: Booleans for Search College of Alameda pmcdermott@peralta.edu Copyright © 2010 Patrick McDermott “Have in mind though that even very advanced searchers,

Google PeraltaAlamedaBerkeleyLaneyMerritt

AlamedaBerkeleyMerritt

AlamedaMerritt

AlamedaBerkeley

Alameda

Search Query:

merritt OR berkeley

ANY one must be True

OR

p q p OR q

true true truetrue false truefalse true truefalse false false

Also |

Page 11: Booleans for Search College of Alameda pmcdermott@peralta.edu Copyright © 2010 Patrick McDermott “Have in mind though that even very advanced searchers,

Google PeraltaAlamedaBerkeleyLaneyMerritt

AlamedaBerkeleyMerritt

AlamedaMerritt

AlamedaBerkeley

Alameda

Search Query:

alameda -laney

True False & False True

NOT

p NOT p

true falsefalse true

Page 12: Booleans for Search College of Alameda pmcdermott@peralta.edu Copyright © 2010 Patrick McDermott “Have in mind though that even very advanced searchers,

Advanced Google

AND“Quote”

OR

NOT