MIT Google: Additional Search Parameters
Overview
You may use additional parameters to
make an Advanced Search form for your site, similar to
http://web.mit.edu/search.html.
The as_q and as_oq parameters allow you
to add hidden search terms to the query your web site sends
to the Google Search Appliance. Unlike as_sitesearch,
these parameters allow you to combine multiple terms
or URLs with Boolean AND/OR logic.
as_sitesearch with as_dt
Use: restrict search to a specific
URL
<input type='hidden' name='as_dt' value='i'/>
<input type='hidden' name='as_sitesearch'
value='web.mit.edu/newsoffice' /> |
Result: finds only pages in the web.mit.edu/newsoffice
site that include the user's search term(s)
Use: exclude pages from a specific
URL
<input type='hidden' name='as_dt' value='e'/>
<input type='hidden' name='as_sitesearch'
value='web.mit.edu/newsoffice' /> |
Result: finds pages in the MIT collection,
but not on the web.mit.edu/newsoffice site, that include
the user's search term(s)
as_q
Use: add one or more search terms
(such as URLs) to the query, combined with boolean
'AND'
<input type='hidden' name='as_q' value='dining
forbes'/> |
Result: finds only pages in the MIT collection
that contain the user's search term(s) AND the terms
'dining' AND 'forbes'.
as_oq
Use: add one or more search terms
(such as URLs) to the query, combined with boolean
'OR'
<input type='hidden' name='as_oq' value='site:www.eecs.mit.edu
site:www.csail.mit.edu'/> |
Result: finds only pages in the www.eecs.mit.edu
OR www.csail.mit.edu sites that include the user's
search term(s)
[Back to top]
Before You Start
The as_q and as_oq parameters have some effects on
the results page that you should be aware of before
using them on your site.
Displaying Results
When the results page for a search is displayed, the
query term is shown in a blue bar at the top of the
results, like this:
|
Results
1 - 15
of about 5140
for
admissions.
|
("admissions" is the search term entered
by the user)
When you add search terms to a query,
those terms are also displayed in the blue bar. E.g., if you use as_sitesearch to restrict
the search to a specific site, it would display like
this:
|
Results
1 - 15
of about 24
for
admissions site:www.eecs.mit.edu.
|
If you use as_q to add key words to a query, the keywords are simply appended:
|
Results
1 - 15
of about 2440
for
admissions undergraduate.
|
If you use as_oq to add multiple URLs to a query:
|
Results
1 - 15
of about 27
for
admissions site:www.eecs.mit.edu OR site:admissions.mit.edu.
|
The blue bar stretches in width—depending on
how many URLs you've specified—to the point where
it may exceed the browser window size and require horizontal
scrolling.
Collections (formerly termed "subcollections")
As an alternative to using these search parameters,
schools and other large organizations may be eligible
to define a collection (a list of URL patterns that
can be referred to by a single name to restrict queries)
in the Google Search Appliance. Use of a collection
to restrict searches avoids the results display and
next search effects of the as_q and as_oq parameters.
Defining and using a collection requires startup
effort from both the MIT search administrator and
the web site developer.
[Back to top]
Using
the Parameters
Using
the as_q and as_oq parameters
as_q (AND)
Add the following line to the search <form>
tag in your web page:
<input type='hidden' name='as_q'
value='<yourterms>'/> |
In place of <yourterms>, list the terms you
want to add to your users' queries, separated by a
space. Prefix a URL with "site:".
e.g.:
'techtalk the-tech'
'site:www.eecs.mit.edu admissions'
as_oq (OR)
Add the following line to the search <form>
tag in your web page:
<input type='hidden' name='as_oq' value='<yourterms>'/> |
In place of <yourterms>, list the terms you
want to add to your users' queries, separated by a
space. Prefix a URL with "site:".
e.g.:
'site:web.mit.edu/newsoffice site:www-tech.mit.edu'
'alumni site:alum.mit.edu'
(See Instructions for Web Publishers for details
about the <form> tag.)
[Back to top]
Reference Guide
For further information on additional search parameters consult the Google Search Protocol
Reference, which documents all the supported search parameters in
detail.
If you have questions about using these
parameters with the Google Search Appliance,
send
a request to the MIT-Google Team.
[Back to top]
|