Generally speaking, there are two types of search engines on the Internet. The first is called the searchable subject index. This kind of search engine searches only the titles and descriptions of sites, and doesnât search individual pages. Yahoo! is a searchable subject index. Then thereâs the full-text search engine, which uses computerized âspidersâ to index millions, sometimes billions, of pages. These pages can be searched by title or content, allowing for much narrower searches than searchable subject index. Google is a full-text search engine.
Whenever you search for more than one keyword at a time, a search
engine has a default method of how to handle that keyword. Will the
engine search for both keywords or for either keyword? The answer is
called a Boolean default; search engines can default to Boolean
AND
(itâll search for both
keywords) or Boolean OR
(itâll
search for either keyword). Of course, even if a search engine
defaults to searching for both keywords (AND
) you
can usually give it a special command to instruct it to search for
either keyword (OR
). But the engine has to know
what to do if you donât give it instructions.
Googleâs Boolean default is AND
; that
means if you enter query words without modifiers, Google will search
for all of them. If you search for:
snowblower Honda "Green Bay"
Google will search for all the words. If you want to specify that either word
is acceptable, you put an OR
between each item:
snowblower OR snowmobile OR "Green Bay"
If you want to definitely have one term and have one of two or more other terms, you group them with parentheses, like this:
snowblower (snowmobile OR "Green Bay")
This query searches for the word
âsnowmobileâ or phrase
âGreen Bayâ along with the word
âsnowblower.â A stand-in for
OR
borrowed from the computer programming realm is
the |
(pipe) character, as in:
snowblower (snowmobile | "Green Bay")
If you want to specify that a query item must not appear in your
results, use a -
(minus sign or dash).
snowblower snowmobile -"Green Bay"
This will search for pages that contain both the words âsnowblowerâ and âsnowmobile,â but not the phrase âGreen Bay.â
The Iâm Feeling Luckyâ¢
button is a thing of beauty. Rather than giving
you a list of search results from which to choose,
youâre whisked away to what Google believes is the
most relevant page given your search, a.k.a. the top first result in
the list. Entering washington post
and clicking
the Iâm Feeling Lucky button will take you directly
to http://www.washingtonpost.com/. Trying
president
will land you at http://www.whitehouse.gov/.
Some search
engines are âcase sensitiveâ; that
is, they search for queries based on how the queries are capitalized.
A search for "GEORGE
WASHINGTON"
on such a search engine would not find
âGeorge Washington,â
âgeorge washington,â or any other
case combination. Google is not case sensitive. If you search for
Three
, three
, or
THREE
, youâre going to get the
same results.
There are a couple of other considerations you need to keep in mind when using Google. First, Google does not accept more than 10 query words, special syntax included. If you try to use more than ten, theyâll be summarily ignored. There are, however, workarounds [Hack #5].
Second, Google does not support
âstemming,â
the
ability to use an asterisk (or other wildcard) in the place of
letters in a query term. For example, moon*
in a
search engine that supported stemming would find
âmoonlight,â
âmoonshot,â
âmoonshadow,â etc. Google does,
however,
support an asterisk as a full word
wildcard [Hack #13]. Searching for
"three
*
mice"
in Google would find âthree
blind mice,â âthree blue
mice,â âthree red
mice,â and so forth.
On the whole, basic search syntax along with forethought in keyword choice will get you pretty far. Add to that Googleâs rich special syntaxes, described in the next section, and youâve one powerful query language at your disposal.
Get Google Hacks now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.