Skip to content Skip to navigation

Additional Search Parameters

The as_q and as_oq parameters allow you to add search terms to the query your web site passes to the Stanford Google Custom Search. Unlike as_sitesearch, these parameters allow you to combine multiple terms or URLs with boolean AND or OR. Restriction to multiple site URLs is not supported.

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.stanford.edu/dept/classics" />

result: finds only pages in the stanford.edu/dept/classics site that include the user's search term(s). Use web.stanford.edu instead of www.stanford.edu in the as_sitesearch parameter. If the search results seem incomplete, use *.stanford.edu for sites hosted on AFS that have been previously indexed at www.stanford.edu.

use: exclude pages from a specific URL

<input type="hidden" name="as_dt" value="e" />
<input type="hidden" name="as_sitesearch" value="gostanford.com" />

result: finds pages in the Stanford collection, but not on the gostanford.com site, that include the user's search term(s).

as_q

use: add one or more search terms to the query, combined with boolean 'AND'

<input type="hidden" name="as_q" value="gsb sloan" />

result: finds only pages in the Stanford collection that contain the user's search term(s) AND the terms 'gsb' AND 'sloan'.

as_oq

use: add one or more search terms to the query, combined with boolean 'OR'

<input type="hidden" name="as_oq" value="gsb sloan" />

result: finds only pages in the Stanford collection that include the user's search term(s) OR the terms 'gsb' AND 'sloan'.

If you have questions about using these parameters with the Stanford Google Custom Search, please submit a HelpSU request.

Last modified March 13, 2015