Special Search Terms
Introduction
Special search terms can be used to perform advanced searches. For example, to search for documents with certain words in the title, or documents that contain all of a series of words.
Special search terms can be entered just like ordinary words in a search requester. For example, entering "fishing" will perform a full text search of all documents for the word "fishing". However, "fishing intitle:fly" will search for documents that contain the word fishing somewhere in them, but have "fly" in the title.
Default Searches
Full text searches, searching for any or all of the search terms is the default behaviour.
Exact Text Searches
To search for some text exactly, enclose it in quotes. For example:
fly fishing
"fly fishing"
The first example searches for "fly" or "fishing", or both (the default behaviour). The second example searches for the words "fly fishing". For a document to be returned, it must have those two words, in that order, next to each other (so "fly ruins fishing expedition" and "fishing fly" would not match, but "fly fishing by J.R.Hartley" would).
"In Body" Searches
To search in the body of the document, without searching titles, URLs etc, the "inbody:" prefix can be used. For example:
inbody:fly
inbody:fly inbody:fishing
The first example will search the main text of all documents for the word "fly". Documents that have that word in the title but not the body will not be returned. The second example searches for "fly" or "fishing" or both in the body of documents.
"In Title" Searches
To search in the title of documents, use the "intitle:" prefix. For example:
intitle:fly
intitle:fly intitle:fishing
intitle:"fly fishing"
Here, the first example performs a search on the title only, looking for the word "fly". The second example searches titles only, but for the word "fly" or the word "fishing" (or both). The last example searches titles for both words, in that order, much like Exact Text Searching.
"In Title" search terms can be intermixed with other special search terms if required.
"In URL" Searches
To search for documents who's URLs contain some text, use the "inurl:" prefix. For example:
inurl:products
inurl:products inurl:domestic
The first example searches for documents which have the word "products" in their urls. For example, "http://www.example.com/products/main.html" would match, as would "http://products.example.com/". The second example searches in the same way for "products" or "domestic", or both.
The precise and compact nature of URLs may make searching in this way less likely to produce many search results. "In URL" search terms can be intermixed with other special terms if required.
"Site" Search Limiters
Site search limiters restrict the search to a particular area of a web site. For example:
site:www.example.com/products/ bargain
site:http://support.example.com troubleshooting
The first example searches for documents that contain the word "bargain" that are located below "www.example.com/products/". Pages such as "http://www.example.com/products/domestic.html" would match, where as "http://www.example.com/bargains.html" would not.
The second example searches for "troubleshooting", but only for pages that can be retrieved by HTTP (as opposed to HTTPS or FTP) that are located on the support.example.com server.
Note: using the "site:" prefix on it's own does not perform a search; it is a search limiter that requires other search terms to initiate the actual search.
"File Type" Search Limiters
File type search limiters restrict the search to particular file types (actually, it limits the search to the file extension). For example:
filetype:html fishing
This example will search for documents with a ".html" suffix that contain the word "fishing". This usually works as expected, but not all HTML files have a ".html" extension (for example, many PHP applications work with HTML but use the suffix ".php").
Note: using the "filetype:" prefix on it's own does not perform a search; it is a search limiter that requires other search terms to initiate the actual search.
Mime Type Search Limiters
Mime Type search limiters restrict the search to particular MIME types. For example:
mimetype:text/html fishing
This example will search for HTML documents only that contain the word "fishing". Unlike "filetype:" this search will find any HTML documents, regardless of their file extension. Like the "filetype:" limiter, this prefix on it's own does not perform a search; it requires other terms to initiate an actual search.
Boolean Searches
Searches can also contain booleans. That is, terms such as AND, OR, NOT. These can control the precision of the search. For example:
fly AND fishing
fly fishing NOT trout
The first example will search for the words "fly" and "fishing", no matter where they are (in contrast to "fly fishing" which requires the words to be in that order and next to each other). The second example searches for all documents that contain "fly" or "fishing", or both, but do not contain the word "trout".
The default is that all terms are optional (ie. term1 OR term2). However, an OR boolean is provided for completeness. Booleans can cause redundant terms to be entered. For example "NOT trout AND fishing" is interpreted as "trout AND fishing", so the initial "NOT" is redundant; there are some limitations on the complexity of boolean searches (mostly in the order and precedence of terms).
Boolean searches can also be performed using "+", "|" and "-" instead of AND, OR and NOT respectively, although only by prefixing terms. For example the following are equivalent:
summer OR fly AND fishing NOT trout
summer |fly +fishing -trout