Jump to content

Better searches with Boolean algebra searching


Flasche

Recommended Posts

Here are some nice spoilers that will help you search a site much easier.

Google

Search operators

Narrow down your search results by adding symbols and words to your search called search operators. Don’t worry about memorizing every operator - you can also use the Advanced Search page to create these searches.

When you search using an operator, don't add any spaces between the operator and your query. A search for site:nytimes.com will work, but site: nytimes.com will not.

Search for an exact word or phrase

"search"

Use quotes to search for an exact word or set of words on a web page. This is helpful when searching for song lyrics or a line from a book. But only use this if you're looking for an exact word or phrase, otherwise you'll exclude many helpful results by mistake.

"imagine all the people"

Exclude a word

-search

Add a dash (-) before a word or site to exclude all results that include that word. This is especially useful for words with multiple meanings, like Jaguar the car brand and jaguar the animal.

jaguar speed -car

pandas -site:wikipedia.org

Search within a site or domain

site:

Get results only from certain sites or domains. For example, you can find all mentions of "olympics" on the New York Times website, or any .gov websites.

olympics site:nbc.com

olympics site:.gov

Search for pages that link to a URL

link:

Find pages that link to a certain page. For example, you can find all the pages that link to google.com.

link:google.com

Search for pages that are similar to a URL

related:

Find sites that are similar to a URL you already know. If you search for related sites to the Time.com, you'll find other news publication sites you may be interested in.

related:time.com

Fill in the blank

*

Add an asterisk within a search as a placeholder for any unknown or wildcard terms. Use with quotation marks to find variations of that exact phrase or to remember words in the middle of a phrase.

"a * saved is a * earned"

Search for either word

OR

If you want to search for pages that may have just one of several words, include OR (capitalized) between the words. Without the OR, your results would typically show only pages that match both terms.

world cup location 2014 OR 2018

Search for a number range

..

Separate numbers by two periods without spaces (..) to see results that contain numbers in a given range of things like dates, prices, and measurements.

camera $50..$100

Find information about a site

info:

Get information about a URL, including the cached version of the page, similar pages, and pages that link to the site.

info:google.com

See a cached version of a site

cache:

See what a page looks like the last time Google crawled the site.

cache:washington.edu

Punctuation

When you search, most punctuation and special characters are ignored. However, there are some punctuation and symbols that work in searches.

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Punctuation and symbols in search

You can use some punctuation and symbols to change your search terms. Except for the examples below, most punctuation is ignored. For example, a search for [courtney@dogs.com] is seen by Google as [courtney dogs com].

Punctuation and symbols that work in Google search Symbol What you can use it for [+] Search for things like blood type [AB+] or for a Google+ page like [+Chrome] [@] Find social tags like [@google] [&] Find strongly connected ideas and phrases like [A&E] [%] Search for a percent value like [40% of 80] [$] Indicate prices, like [nikon $400] [#] Search for trending topics indicated by hashtags like [#lifewithoutgoogle] [-] Indicate that words around it are strongly connected like [twelve-year-old dog] [_] Connect two works like [quick_sort]. Your search results will find this pair of words either linked together (quicksort) or connected by an underscore (quick_sort).

Even though the symbols listed above are supported, including them in your searches doesn’t always improve the results. In these cases, you may see suggested results for that search without punctuation if those results seem more useful.

Search operators Some symbols and words can be added to searches to help narrow down the results, like using the minus sign to remove a word from your search results. These symbols and words are called search operators.

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Google advanced search (if you don't want to use Boolean at all)

http://www.google.com/advanced_search

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Boolean searching in general

http://lib.colostate.edu/tutorials/boolean.html (interactive page not sure if older systems can handle well)

http://pdf.textfiles.com/security/googlehackers.pdf

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

More Boolean terms

Search Operators

The following table lists the search operators that work with each Google search service. Click on an operator to jump to its description — or, to read about all of the operators, simply scroll down and read all of this page.

Search Service Search Operators Web Search allinanchor:, allintext:, allintitle:, allinurl:, cache:, define:, filetype:, id:, inanchor:, info:, intext:, intitle:, inurl:, link:, related:, site: Image Search allintitle:, allinurl:, filetype:, inurl:, intitle:, site: Groups allintext:, allintitle:, author:, group:, insubject:, intext:, intitle: Directory allintext:, allintitle:, allinurl:, ext:, filetype:, intext:, intitle:, inurl: News allintext:, allintitle:, allinurl:, intext:, intitle:, inurl:, location:, source: Product Search allintext:, allintitle:

The following is an alphabetical list of the search operators. This list includes operators that are not officially supported by Google and not listed in Google’s online help.

Each entry typically includes the syntax, the capabilities, and an example. Some of the search operators won’t work as intended if you put a space between the colon ( :) and the subsequent query word. If you don’t care to check which search operators require no space after the colon, always place the keyword immediately next to the colon. Many search operators can appear anywhere in your query. In our examples, we place the search operator as far to the right as possible. We do this because the Advanced Search form writes queries in this way. Also, such a convention makes it clearer as to which operators are associated with which terms.

Note: Google may change how undocumented operators work or may eliminate them completely.

allinanchor:

If you start your query with allinanchor:, Google restricts results to pages containing all query terms you specify in the anchor text on links to the page. For example, [ allinanchor: best museums sydney ] will return only pages in which the anchor text on links to the pages contain the words “best,” “museums,” and “sydney.”

Anchor text is the text on a page that is linked to another web page or a different place on the current page. When you click on anchor text, you will be taken to the page or place on the page to which it is linked. When using allinanchor: in your query, do not include any other search operators. The functionality of allinanchor: is also available through the Advanced Web Search page, under Occurrences.

allintext:

If you start your query with allintext:, Google restricts results to those containing all the query terms you specify in the text of the page. For example, [ allintext: travel packing list ] will return only pages in which the words “travel,” “packing,” and “list” appear in the text of the page. This functionality can also be obtained through the Advanced Web Search page, under Occurrences.

allintitle:

If you start your query with allintitle:, Google restricts results to those containing all the query terms you specify in the title. For example, [ allintitle: detect plagiarism ] will return only documents that contain the words “detect” and “plagiarism” in the title. This functionality can also be obtained through the Advanced Web Search page, under Occurrences.

The title of a webpage is usually displayed at the top of the browser window and in the first line of Google’s search results for a page. The author of a website specifies the title of a page with the HTML TITLE element. There’s only one title in a webpage. When using allintitle: in your query, do not include any other search operators. The functionality of allintitle: is also available through the Advanced Web Search page, under Occurrences.

In Image Search, the operator allintitle: will return images in files whose names contain the terms that you specify.

In Google News, the operator allintitle: will return articles whose titles include the terms you specify.

allinurl:

If you start your query with allinurl:, Google restricts results to those containing all the query terms you specify in the URL. For example, [ allinurl: google faq ] will return only documents that contain the words “google” and “faq” in the URL, such as “www.google.com/help/faq.html”. This functionality can also be obtained through the Advanced Web Search page, under Occurrences.

In URLs, words are often run together. They need not be run together when you’re using allinurl:.

In Google News, the operator allinurl: will return articles whose titles include the terms you specify.

The Uniform Resource Locator, more commonly known as URL, is the address that specifies the location of a file on the Internet. When using allinurl: in your query, do not include any other search operators. The functionality of allinurl: is also available through the Advanced Web Search page, under Occurrences.

author:

If you include author: in your query, Google will restrict your Google Groups results to include newsgroup articles by the author you specify. The author can be a full or partial name or email address. For example, [ children author:john author:doe ] or [ children author:doe@someaddress.com ] return articles that contain the word “children” written by John Doe or doe@someaddress.com.

Google will search for exactly what you specify. If your query contains [ author:”John Doe” ] (with quotes), Google won’t find articles where the author is specified as “Doe, John.”

cache:

The query cache:url will display Google’s cached version of a web page, instead of the current version of the page. For example, [ cache:www.eff.org ] will show Google’s cached version of the Electronic Frontier Foundation home page.

On the cached version of a page, Google will highlight terms in your query that appear after the cache: search operator. For example, [ cache:www.pandemonia.com/flying/ fly diary ] will show Google’s cached version of Flight Diary in which Hamish Reid’s documents what’s involved in learning how to fly with the terms “fly” and “diary” highlighted.

Note: Do not put a space between cache: and the URL (web address).

define:

If you start your query with define:, Google shows definitions from pages on the web for the term that follows. This advanced search operator is useful for finding definitions of words, phrases, and acronyms. For example, [ define: blog ] will show definitions for “Blog” (weB LOG).

ext:

This is an undocumented alias for filetype:.

filetype:

If you include filetype:suffix in your query, Google will restrict the results to pages whose names end in suffix. For example, [ web page evaluation checklist filetype:pdf ] will return Adobe Acrobat pdf files that match the terms “web,” “page,” “evaluation,” and “checklist.” You can restrict the results to pages whose names end with pdf and doc by using the OR operator, e.g. [ email security filetype:pdf OR filetype:doc ].

When you don’t specify a File Format in the Advanced Search Form or the filetype: operator, Google searches a variety of file formats; see the table in File Type Conversion.

group:

If you include group: in your query, Google will restrict your Google Groups results to newsgroup articles from certain groups or subareas. For example, [ sleep group:misc.kids.moderated ] will return articles in the group misc.kids.moderated that contain the word “sleep” and [ sleep group:misc.kids ] will return articles in the subarea misc.kids that contain the word “sleep.”

id:

This is an undocumented alias for info:.

inanchor:

If you include inanchor: in your query, Google will restrict the results to pages containing the query terms you specify in the anchor text or links to the page. For example, [ restaurants inanchor:gourmet ] will return pages in which the anchor text on links to the pages contain the word “gourmet” and the page contains the word “restaurants.”

info:

The query info:URL will present some information about the corresponding web page. For instance, [ info:gothotel.com ] will show information about the national hotel directory GotHotel.com home page.

This functionality can also be obtained by typing the web page URL directly into a Google search box.

Note: There must be no space between the info: and the web page URL.

insubject:

If you include insubject: in your query, Google will restrict articles in Google Groups to those that contain the terms you specify in the subject. For example, [ insubject:”falling asleep” ] will return Google Group articles that contain the phrase “falling asleep” in the subject.

Equivalent to intitle:.

intext:

The query intext:term restricts results to documents containing term in the text. For instance, [ Hamish Reid intext:pandemonia ] will return documents that mention the word “pandemonia” in the text, and mention the names “Hamish” and “Reid” anywhere in the document (text or not).

Putting intext: in front of every word in your query is equivalent to putting allintext: at the front of your query, e.g., [ intext:handsome intext:poets ] is the same as [ allintext: handsome poets ].

Note: There must be no space between the intext: and the following word.

intitle:

The query intitle:term restricts results to documents containing term in the title. For instance, [ flu shot intitle:help ] will return documents that mention the word “help” in their titles, and mention the words “flu” and “shot” anywhere in the document (title or not).

Putting intitle: in front of every word in your query is equivalent to putting allintitle: at the front of your query, e.g., [ intitle:google intitle:search ] is the same as [ allintitle: google search ].

Note: There must be no space between the intitle: and the following word.

inurl:

If you include inurl: in your query, Google will restrict the results to documents containing that word in the URL. For instance, [ inurl:print site:www.googleguide.com ] searches for pages on Google Guide in which the URL contains the word “print.” It finds pdf files that are in the directory or folder named “print” on the Google Guide website. The query [ inurl:healthy eating ] will return documents that mention the words “healthy” in their URL, and mention the word “eating” anywhere in the document.

Putting inurl: in front of every word in your query is equivalent to putting allinurl: at the front of your query, e.g., [ inurl:healthy inurl:eating ] is the same as [ allinurl: healthy eating ].

Note: There must be no space between the inurl: and the following word.

In URLs, words are often run together. They need not be run together when you’re using inurl:.

link:

The query link:URL shows pages that point to that URL. For example, to find pages that point to Google Guide’s home page, enter:

[ link:www.googleguide.com ]

Find links to the Google home page not on Google’s own site.

Note: According to Google’s documentation, “you cannot combine a link: search with a regular keyword search.”

Also note that when you combine link: with another advanced operator, Google may not return all the pages that match. The following queries should return lots of results, as you can see if you remove the -site: term in each of these queries.

[ link:www.google.com -site:google.com ]

Find links to the UK Owners Direct home page not on its own site.

[ link:www.www.ownersdirect.co.uk -site:ownersdirect.co.uk ]

location:

If you include location: in your query on Google News, only articles from the location you specify will be returned. For example, [ queen location:canada ] will show articles that match the term “queen” from sites in Canada. Many other country names work; try them and see.

Two-letter US state abbreviations match individual US states, and two-letter Canadian province abbreviations (like NS for Nova Scotia) also work — although some provinces don’t have many newspapers online, so you may not get many results. Some other two-letter abbreviations — such as UK for the United Kingdom — are also available.

movie:

If you include movie: in your query, Google will find movie-related information. For examples, see Google’s Blog.

related:

The query related:URL will list web pages that are similar to the web page you specify. For instance, [ related:www.consumerreports.org ] will list web pages that are similar to the Consumer Reports home page.

You can also find similar pages from the “Similar pages” link on Google’s main results page, and from the similar selector in the Page-Specific Search area of the Advanced Search page. If you expect to search frequently for similar pages, consider installing a GoogleScout browser button, which scouts for similar pages.

Note: Don’t include a space between the related: and the web page url.

site:

If you include site: in your query, Google will restrict your search results to the site or domain you specify. For example, [ admissions site:www.lse.ac.uk ] will show admissions information from London School of Economics’ site and [ peace site:gov ] will find pages about peace within the .gov domain. You can specify a domain with or without a period, e.g., either as .gov or gov.

You can use many of the search operators in conjunction with the basic search operators +, –, OR, and " ". For example, to find information on Windows security from all sites except microsoft.com, enter:

Note: Do not include a space between the “site:” and the domain.

[ windows security –site:microsoft.com ]

You can also restrict your results to a site or domain through the domains selector on the Advanced Search page.

source:

If you include source: in your query, Google News will restrict your search to articles from the news source with the ID you specify. For example, [ election source:new_york_times ] will return articles with the word “election” that appear in the New York Times.

To find a news source ID, enter a query that includes a term and the name of the publication you’re seeking. You can also specify the publication name in the “news source” field in the Advanced News Search form. You’ll find the news source ID in the query box, following the source: search operator. For example, let’s say you enter the publication name Ha’aretz in the News Source box, then you click the Google Search button. The results page appears, and its search box contains [ peace source:ha_aretz__subscription_ ]. This means that the news source ID is ha_aretz__subscription_. This query will only return articles that include the word “peace” from the Israeli newspaper Ha’aretz.

weather

If you enter a query with the word weather and a city or location name, if Google recognizes the location, the forecast will appear at the top of the results page. Otherwise, your results will usually include links to sites with the weather conditions and forecast for that location.

Since weather is not an advanced operator, there is no need to include a colon after the word. For example, [ weather Sunnyvale CA ] will return the weather for Sunnyvale, California and [ weather 94041 ] will return the weather for the city containing the zip code (US postal code) 94041, which is Mountain View, California.

The Google Guide Advanced Operator Quick Reference (www.googleguide.com/advanced_operators_reference.html) provides a nice summary of the search operators grouped by type. It includes search operators not yet documented by Google, e.g., allinanchor:, allintext:, author:, ext:, group:, id:, insubject:, intext:, intitle:, location:, and source:.

Exercises

This problem set is designed to give you experiences with search operators and practice with specifying more precisely what you’re seeking by using the Advanced Search form. For hints and answers to selected problems, see the Solutions page.

  1. Use the site: operator to search for armchairs on IKEA’s site, www.ikea.com.
  2. Use the Advanced Search form to find the page whose title is “Some Ways to Detect Plagiarism.” When the title is entered in lowercase letters, the query box on the results page contains [allintitle: “ways to detect plagiarism” ].
  3. Find all pages on google.com but not on answers.google.com nor on directory.google.com whose titles include the words “FAQ” or “help.”
  4. Use the link: operator to see who links to googleguide.com, your company’s website, or your favorite website.
  5. Find pages whose titles include surfing that are not about surfing the World Wide Web.
  6. Find out where the upcoming international conference on AIDS is being held.
  7. How can you search for [ google help ] on Google Guide, www.googleguide.com, and on the UC Berkeley library website, www.lib.berkeley.edu?

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Boolean exercises! :w00t:

http://www.csub.edu/~cgavin/GST126/booex1.htm

http://umb.libguides.com/content.php?pid=238398&sid=2019763

http://guides.library.ubc.ca/content.php?pid=447625&sid=3809729

http://www.zu.ac.ae/infoasis/modules/mod2/13_boolean_exercise.htm

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Links to pages if you don't like the page copied into a spoiler https://support.google.com/websearch/answer/136861?hl=en , https://support.google.com/websearch/answer/2466433 , and http://www.googleguide.com/advanced_operators_reference.html

Edited by Flasche
Link to comment
Share on other sites


INURL (colon) and INTITLE (colon) also. (google those with "google" also as search term)

Thanks for the extra :thumbup . I'm currently updating the initial post to add even more pages on the web of help.

EDIT: Initial post updated.

Edited by Flasche
Link to comment
Share on other sites

If anyone one else has Boolean search tips post a link (or write it as a response) I'll add it to the main post.

I should point out that only part of what you have in that spoiler is Boolean related. Google dorks are more like cheats and not really part of logic operation IMO.

Link to comment
Share on other sites

I should point out that only part of what you have in that spoiler is Boolean related. Google dorks are more like cheats and not really part of logic operation IMO.

Sure :), only AND, OR, NOT are boolean operators, and to be picky, algebra is nowhere to be seen around this thread, let alone Boolean algebra.

jaclaz

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...