Advanced Google Searching

3 replies
I was looking through the Google API's (yeah, I'm a programmer ) and found some stuff that might be really useful for some people. These are the advanced search parameters that you can pass to Google. Hope it helps some of you.


Query: Anchor text search
Description:
Restricts the search to pages that contain all the search terms in the anchor text of the page. The following example shows an anchor tag:

<a href="http://foo.com">Go Foo</a>

allinanchor: evaluates the text between > and </a>. allinanchor: evaluates only <a href anchor tags. It does not evaluate <a name anchor tags.

An anchor is a marker inserted at a specific section of a page. It lets the writer of the document create links to these anchors, which quickly take the reader to the specified section. The table of contents at the top of this document, for example, uses hyperlinks to anchors embedded throughout this document.

Do not include any other search operators with the allinanchor: operator.
Sample Usage:
Code:
allinanchor:membership directory
Query: Back Links
Description:
The query prefix link: lists web pages that have links to the specified web page. No spaces can come between link and the web page URL.

No other query terms can be specified when using this special query term. Query terms info, link and cache ignore collection restrictions that are specified by the site parameter. The search request parameter as_lq can also be used to submit a link request. See also the site parameter.
Sample Usage:
Code:
link:http://www.google.com
Query: Boolean OR Search
Description:
Google search supports the Boolean OR operator. To retrieve pages that include either word A or word B, use an uppercase OR between terms. The search request parameter, as_oq, can also be used to submit a search for any term in a set of terms.
Sample Usage:
Code:
vacation london OR paris
Query: Cached Results Page
Description:
The query prefix cache: returns the cached HTML version of the specified web document that the Google search crawled. Note there can be no space between cache: and the web page URL. Words that appear in the query are highlighted in the cached document.

To use Google's default cached result display, omit the output parameter in the cache request. To customize the display of cached results, request XML or Custom HTML output as part of the cache request and ensure that your parser or stylesheet handles the incoming cache data. Query terms info, link and cache ignore collection restrictions that are specified by the site parameter.
Sample Usage:
Code:
cache:http://www.google.com web
Query: Date Range Search
Description:
Restrict search to documents with modification dates that fall within a time frame. You can search any dates between 1990-01-01 and 2034-11-09. For a complete list of date formats, see Acceptable Date Formats in Appendix C: Date Formatting.

To specify dates in ISO 8601 format (such as YYYY-MM-DD), use two dots (..) to separate dates in the date range. For example, to search for documents that contain the word parrot and were modified between August 1, 2007 and December 24, 2007, enter the following statement:

parrot daterange:2007-08-01..2007-12-24

You can specify that a search be for all modification dates before a date by preceding the date with the two dots. For example, to search for all documents containing parrot that were modified before August 8, 2008, specify the date range with the following statement::

parrot daterange:..2008-08-08

You can specify that a search be for all documents that were modified after a specific date by specifying a date followed by two dots. For example, to search for all documents that were modified after January 1, 2008 that contain parrot, specify the date range with the following statement:

parrot daterange:2008-01-01..

To specify how a search appliance sorts search results by document dates, use Crawl and Index > Document Dates in the Admin Console. You can sort search results by the dates found in a document's URL, a meta tag, the title, the body, or when the document was last modified. If you choose to sort by a meta tag, the meta tag that you specify can contain only a date.

Dates in Julian format can be treated as a date range only with the daterange keyword. Without the daterange keyword, Julian dates are considered a number range search. (A Julian date is an integer number of days that have elapsed since noon on January 1, 4713 BC. For example, August 1, 2008 at noon has a Julian date of 2454680.)

For further options for searching dates in meta tags, see Using inmeta to filter by meta tags.

Sample Usage:
Code:
election daterange:2004-01-13..2006-01-13

election daterange:2008-01-01..

election daterange:..2008-01-01

daterange:2452122-2452234
Query: Directory Restricted Search
Description:
Restrict search to documents within a domain or directory. Enter the query followed by site: followed by the host name and path of the web directory. To limit the search to a domain, specify a string that matches a complete name-segment of the canonical host name.

To search a particular directory on a web server (including the root directory), specify a string that is the complete canonical name of the host server followed by the path of the directory. If the forward slash character (/) is at the end of the web directory path specified, then search is limited to the files within that directory. Files in sub-directories are not considered.

The URLs used with site must contain fewer than 119 characters. The exclusion operator (-) can be applied to this to remove a web directory from consideration in the search. Only one site term per search request can be submitted.

The search request parameters, as_sitesearch and as_dt can also be used to submit directory restricted searches. See also the site parameter.
Sample Usage:
Code:
Domain search examples:

site:http://www.google.com
site:google.com
site:com

 
Directory search examples:

admission site:http://www.stanford.edu/group/uga
site:http://www.google.com/enterprise/
site:http://www.google.com/about
Query: Exclusion
Description:
Sometimes what you're searching for has more than one meaning. For example, the term "bass" can refer to either fishing or music. You can exclude a word from your search by putting a minus sign (-) immediately in front of the term you want to exclude from the search results. Be sure to include a space before the minus character.

The search request parameter, as_eq, can also be used to submit terms to exclude.
Sample Usage:
Code:
bass -music
Query: File Type Filtering
Description:
The query prefix filetype: filters the results to include only documents with the specified file extension. No spaces can come between filetype: and the specified extension.

You can specify multiple file types by adding filetype: terms to the search query, combined with the Boolean OR.
Sample Usage:
Code:
Google filetype:doc OR filetype:pdf
Query: File Type Exclusion
Description:
The query prefix-filetype: filters the results to exclude documents with the specified file extension. No spaces can come between -filetype: and the specified extension.

You can exclude multiple file types by adding more -filetype terms to the search query.
Sample Usage:
Code:
Google -filetype:doc 
-filetype:pdf
Query: Meta Tag Search
Description:
You can filter results by meta tags and their values using inmeta. Used with the operators ~ or =, inmeta restricts results to required or partial meta tag values in the same way as the requiredfields and partialfields search parameters. See Meta Tags for more details.
Sample Usage:
Code:
inmeta:department=Human Resources
Query: Number Range Search
Description:
To search for documents or items that contain numbers within a range, type your search term and the range of numbers separated by two periods (..). You can set ranges for weights, dimensions, prices (dollar currencies only), and so on. Be sure to specify a unit of measurement or some other indicator of what the number range represents.
Sample Usage:
Code:
pencils $1.50..$2.50
Query: Phrase Search

Description:
Search for complete phrases by enclosing them in quotation marks or by connecting them with hyphens. Words marked in this way appear together in all results, exactly as you enter them. Phrase searches are especially useful when searching for famous sayings or proper names.

You can also use the as_epq search request parameter to submit a phrase search.
Sample Usage:
Code:
"yellow pages"
yellow-pages
Query: Title Search (one term)
Description:
If you precede a query term with intitle:, Google search restricts the results to documents containing that word in the title.

Putting intitle: in front of every word in your query is equivalent to putting allintitle: at the front of your query.
Sample Usage:
Code:
intitle:google
Query: Title Search (all terms)
Description:
If you precede a query with allintitle: Google search restricts the results to those with all of the query words in the result title.
Sample Usage:
Code:
allintitle:google search
Query: URL Search (one term)
Description:
If you precede a query term with inurl:, Google search restricts the results to documents containing that word in the result URL. No spaces can come between the inurl: and the following word.

The term inurl works only on words, not on URL components. In particular, it ignores punctuation and uses only the first word following the inurl: operator. To find multiple words in a result URL, use the inurl: operator for each word. Preceding every word in your query with inurl: is equivalent to putting allinurl: at the front of your query.
Sample Usage:
Code:
inurl:Google search
Query: URL Search (all terms)
Description:
If you precede a query with allinurl: Google search restricts the results to those with all of the query words in the result URL.

The term allinurl works only on words, not URL components. In particular, it ignores punctuation. Thus, allinurl: foo/bar restricts the results to page with the words "foo" and "bar" in the URL, but doesn't require that they be separated by a slash within that URL, that they be adjacent, or that they be in that particular word order. There is currently no way to enforce these constraints.
Sample Usage:
Code:
allinurl: Google search
Query: Web Document Info
Description:
The query prefix info: returns a single result for the specified URL if the URL exists in the index. No other query terms can be specified when using this special query term. Query terms info, link and cache ignore collection restrictions that are specified by the site parameter. See also the site parameter.
Sample Usage:
Code:
info:http://www.google.com
#advanced #google #searching
  • Profile picture of the author Perry Blouin
    Thanks... Good tips.
    I'll put them to use right away.
    {{ DiscussionBoard.errors[1526895].message }}
  • Profile picture of the author freudianslip27
    Thanks for the share! I wasn't aware of a few of these and they will come in handy for the future. Very detailed description too.

    Matt
    Signature

    WarriorForum Rules!

    {{ DiscussionBoard.errors[1527205].message }}
  • Profile picture of the author Benjamin Ehinger
    Great tips thanks for the post.
    {{ DiscussionBoard.errors[1527343].message }}

Trending Topics