Request Format
•
|
Request Overview
The search request is a URL that combines the following:
The GET command has a 2KB limit on query strings. To submit longer query strings, use the POST command, as described in Using the POST Command.
Using the POST Command
POST Limitations
POST support is only available for:
•
|
If you are sending non UTF-8 data, you must include the ie parameter (described on page 16) in the POST body. This parameter sets the character encoding that is used to interpret the query string. You should also specify the access parameter (as shown in Search Request Examples (POST command)) in the POST body when sending POST requests.
The following search parameters are not included by default in a POST request:
•
|
If you want to include any of these parameters in a POST request, you must add them. For more information about these parameters, see Search Parameters.
Structure of the POST Body
Submitting a Search Request
<form method="GET" action="http://search.mycompany.com/search">
<input type="text" name="q" size="32" maxlength="256" value="query string">
<input type="submit" name="btnG" value="Google Search">
<input type="hidden" name="site" value="default_collection">
<input type="hidden" name="client" value="default_frontend">
<input type="hidden" name="output" value="xml_no_dtd">
<input type="hidden" name="proxystylesheet" value="default_frontend">
</form>
http://search.mycompany.com/search?q=query+string
&site=default_collection
&client=default_frontend
&output=xml_no_dtd
&proxystylesheet=default_frontend HTTP/1.0
Alternatively, a web application may make a HTTP GET request directly:
GET /search?q=query+string&site=default_collection
&client=default_frontend
&output=xml_no_dtd
&proxystylesheet=default_frontend HTTP/1.0
You can search multiple collections by separating collection names with the OR character ( | ) or the AND character (.), for example: &site=col1.col2 or &site=col1|col2.
The rest of the examples that follow use the raw HTTP GET format (as in the last example).
Search Request Examples (GET Command)
Example 1. This request returns the first 10 results that match the search query terms “bill” and “material”:
GET /search?q=bill+material&output=xml&client=test&site=operations HTTP/1.0
The search query is “bill material”.
GET /search?q=bill+material&output=xml&client=test&site=operations HTTP/1.0
Search is limited to the documents in the “operations” collection.
GET /search?q=bill+material&output=xml&client=test&site=operations HTTP/1.0
Results are returned in the Google XML output format.
GET /search?q=bill+material&output=xml&client=test&site=operations HTTP/1.0
Example 2. This request returns results numbered 11-15 that match the same query terms and collection as example 1. As specified by the proxystylesheet parameter, the results are rendered in the custom HTML output format defined by the front end named “test.”
GET /search?q=bill+material&start=10&num=5&output=xml_no_dtd&proxystylesheet=
test&client=test&site=operations HTTP/1.0
This search request uses the same search query terms and collection as in Example 1.
GET /search?q=bill+material&start=10&num=5&output=xml_no_dtd&proxystylesheet=
test&client=test&site=operations HTTP/1.0
Results numbered 11–15 are returned.
GET /search?q=bill+material&start=10&num=5&output=xml_no_dtd&proxystylesheet=
test&client=test&site=operations HTTP/1.0
Results are returned in custom HTML output format, which is created by applying the XSL stylesheet associated with the “test” front end to the standard XML results. See proxystylesheet.
GET /search?q=bill+material&start=10&num=5&output=xml_no_dtd&proxystylesheet=
test&client=test&site=operations HTTP/1.0
Example 3. This request returns the first 10 German results that match the search query “Star Wars Episode +I”:
GET /search?q=Star+Wars+Episode+%2BI&output=xml_no_dtd&lr=lang_de&ie=
latin1&oe=latin1&client=test&site=movies&proxystylesheet=test HTTP/1.0
GET /search?q=Star+Wars+Episode+%2BI&output=xml_no_dtd&lr=lang_de&ie=
latin1&oe=latin1&client=test&site=movies&proxystylesheet=test HTTP/1.0
Results show the first 10 German results.
GET /search?q=Star+Wars+Episode+%2BI&output=xml_no_dtd&lr=lang_de&ie=latin1&oe=
latin1&client=test&site=movies&proxystylesheet=test HTTP/1.0
GET /search?q=Star+Wars+Episode+%2BI&output=xml_no_dtd&lr=lang_de&ie=latin1&oe=
latin1&client=test&site=movies&proxystylesheet=test HTTP/1.0
Search Request Examples (POST command)
POST /search HTTP/1.0
This request returns the first 10 results that match the search query terms “bill” and “material”:
q=bill+material&output=xml&client=test&site=operations&access=p
This request returns results numbered 11-15 that match the same query terms and collection as example 1. As specified by the proxystylesheet parameter, the results are rendered in the custom HTML output format defined by the front end named “test.”
q=bill+material&start=10&num=5&output=xml_no_dtd&proxystylesheet=test
&client=test&site=operations&access=p
Search Parameters
All search requests must include the parameters site, client, q, and output. All parameter values must be URL-encoded (see Appendix B: URL Encoding), except where otherwise noted.
access
Specifies whether to search public content, secure content, or both.
Possible values for the access parameter are:
as_dt
Modifies the as_sitesearch parameter as follows:
Include only results in the web directory specified by as_sitesearch |
|
Exclude all results in the web directory specified by as_sitesearch |
For example, to exclude results, use as_dt=e.
as_epq
Adds the specified phrase to the search query in parameter q.
For example, to add the terms “hello there” use as_epq=hello there
This parameter has the same effect as using the phrase special query term (see Phrase Search).
Default value: Empty string
as_eq
Excludes the specified terms from the search results.
For example, to filter out results that contain the term “deprecated,” use as_eq=deprecated
This parameter has the same effect as using the exclusion (-) special query term (see Exclusion).
Default value: Empty string
as_filetype
Specifies a file format to include or exclude in the search results. Modified by the as_ft parameter. For a list of possible values, see File Type Filtering.
For example, to include only pdf files in results, use as_filetype=pdf
Default value: Empty string
as_ft
Modifies the as_filetype parameter to specify filetype inclusion and exclusion options. The values for as_ft are:
Adds the special query term filetype: to the query followed by the value of as_filetype. |
|
Adds the special query term -filetype: to the query followed by the value of as_filetype. |
For example, to add the special query term filetype:, use as_ft=i
Query is the string that is included in the response’s q element. Both as_filetype and as_ft are also returned in the response’s PARAM elements.
Default value: Empty string
as_lq
Specifies a URL, and causes search results to show pages that link to the that URL. This parameter has the same effect as the link special query term (see Back Links). No other query terms can be used when using this parameter.
For example, to return results that have links to http://myUrl.com/Page, use
as_lq=http://myUrl.com/Page
Default value: Empty string
as_occt
For example to specify that the search engine should only look in titles, use as_occt=title
Default value: any
as_oq
Combines the specified terms to the search query in parameter q, with an OR operation.
For example to search for documents that contain the terms“London” or “Paris,” use:
as_oq=London Paris, as_oq=London%20Paris, or as_oq=London+Paris
This parameter has the same effect as the OR special query term and is used only for single words (see Boolean OR Search).
Default value: Empty string
as_q
Adds the specified query terms to the query terms in parameter q.
For example, to add the terms “enterprise” and “large” use as_q=enterprise large
Default value: Empty string
as_sitesearch
Limits search results to documents in the specified domain, host or web directory, or excludes results from the specified location, depending on the value of as_dt. This parameter has the same effect as the site or -site special query terms. It has no effect if the q parameter is empty.
When the Google Search Appliance receives a search request that includes the as_sitesearch parameter, it converts the value of the parameter into an argument to the site special query term and appends it to the value of q in the search results. For example, suppose that a search contains these parameters:
q=mycompany&as_sitesearch=www.mycompany.com
The raw XML of the search results contains the following:
<q>mycompany site:www.mycompany.com</q>
The default XSLT stylesheet displays the value of the q tag in the search box on the results page. Consequently, using an as_sitesearch parameter changes the user’s search query by modifying the contents of the search box.
The specified value for as_sitesearch must contain fewer than 125 characters. See also the site parameter (see site).
Default value: Empty string
client
dnavs
Used when the dynamic navigation feature is enabled and applied to a front end.
This parameter stores the current dynamic navigation filters applied in the search results. It does not affect the search results in any way and is used only in the XSLT rendering logic. Dynamic navigation uses the q parameter for affecting search results by appending the selected filters as inmeta: query terms.
entqr
This parameter sets the query expansion policy according to the following valid values:
Standard (entqr=1)—Uses only the search appliance’s synonym file. |
|
Local (entqr=2)—Uses all displayed and activated synonym files. |
|
Full (entqr=3)—Uses both standard and local synonym files. |
If this parameter is omitted, the query expansion value specified for the front end is used.
entqrm
The entqrm parameter controls query expansions for meta tags according to the following valid values::
Names (entqrm=1) Enables query expansion only for meta-tag names. |
|
Values (entqrm=2) Enables query expansion only for meta-tag values. |
|
Both (entqrm=3) Enables query expansion for both meta-tag names and values. |
entsp
The entsp parameter controls the use of the advanced relevance scoring parameters that you set under Result Biasing on the Admin Console. The parameter accepts the following valid values:
If you do not specify a value for the entsp parameter in the search request, the scoring policy specified for the current front end is used. For example, if the search appliance uses a front end called my_frontend in which the scoring policy my_scorepolicy is configured, omitting the entsp parameter means that the scoring policy my_scorepolicy is used. |
|
Specifies that the default scoring policy for the search appliance is used. It should be named as default_policy. |
|
Specifies a particular advanced scoring policy. For example, for a source biasing policy called mypolicy, the parameter is set with the following syntax: entsp=a__mypolicy Note that the above syntax uses two underscores between the a and the name of the source biasing policy. |
exclude_apps
If you omit the exclude_apps parameter in the search request, Google Apps content will not display in search results. |
|
(exclude_apps=0). Google Apps content will display in search results, as determined by the Google Apps results sidebar element in the front end. See the table below. |
The following table lists how Google Apps content will display in search results based on the values of the exclude_apps and only_apps search parameters, and the setting of the Google Apps results sidebar option in the front end. See also only_apps.
filter
Activates or deactivates automatic results filtering. By default, filtering is applied to Google search results to improve results quality. See Automatic Filtering for more information.
getfields
Indicates that the names and values of the specified meta tags should be returned with each search result, when available. See Meta Tags for more information.
Meta tag names or values must be double URL-encoded (see Appendix B: URL Encoding).
Default value: Empty string
gsaRequestID
Default value: None.
ie
Sets the character encoding that is used to interpret the query string. See Internationalization for more information.
Default value: latin1
ip
When queries are made using the HTTP or HTTPS protocol, the ip parameter contains the IP address of the user who submitted the search query. You do not supply this parameter with the search request. The ip parameter is returned in the XML search results. For example:
<PARAM name="ip" value="172.24.96.29" original_value="172.24.96.29"/>
Default value: Value is not set in the search request; the value is automatically returned in the search results.
lr
Restricts searches to pages in the specified language. If there are no results in the specified language, the search appliance displays results in all languages. The search appliance may use the language parameter to segment search queries in some Asian languages that do not normally have spaces between words. As a result, you might see different results to your search depending on the value of the lr parameter. See Language Filters for more information.
Default value: Empty string
num
Maximum number of results to include in the search results. The maximum value of this parameter is 1000. Taken together, the values of the start (see start) and num parameters determine the range of the results that are returned.
The initial index point of the search results is the value of the start parameter (see start). The ending index point of the search results is the value of the start parameter (see start) plus the value of the num parameter minus 1. All index points are zero based, meaning the first result has the value 0.
The actual number of results may be smaller than the requested value.
numgm
oe
Sets the character encoding that is used to encode the results. See Internationalization for more information.
Default value: UTF8
only_apps
If you omit the only_apps parameter in the search request, search results will not be restricted to only Google Apps content. |
|
(only_apps=1). Only Google Apps content will display in search results, as determined by the Google Apps results sidebar element in the front end (see exclude_apps). |
output
Selects the format of the search results. Example: output=xml
(See proxystylesheet parameter for details.) |
|
XML results with Google DTD reference. When you use this value, omit proxystylesheet. |
partialfields
(See Meta Tags for more information.)
Meta tag names or values must be double URL-encoded (see Appendix B: URL Encoding).
Default value: Empty string
proxycustom
Specifies custom XML tags to be included in the XML results. The default XSLT stylesheet uses these values for this parameter: <HOME/>, <ADVANCED/>. The proxycustom parameter can be used in custom XSLT applications. See Custom HTML for more information.
This parameter is disabled if the search request does not contain the proxystylesheet tag. If custom XML is specified, search results are not returned with the search request.
Meta tag names or values must be double URL-encoded (see Appendix B: URL Encoding).
Default value: Empty string
proxyreload
Instructs the Google Search Appliance when to refresh the XSL stylesheet cache. A value of 1 indicates that the Google Search Appliance should update the XSL stylesheet cache to refresh the stylesheet currently being requested. This parameter is optional. By default, the XSL stylesheet cache is updated approximately every 15 minutes. (See Custom HTML for more information.) Take note that updating the XSL stylesheet cache increases latency for the search request and should not be used in production environment with high load or during performance testing.
proxystylesheet
If the value of the output parameter is xml_no_dtd, the output format is modified by the proxystylesheet value as follows:
See Custom HTML for more details. Notice that a valid front end and the policies defined for it are determined by the client parameter. If the proxystylesheet value is an empty string (""), an error is returned.
Default value: N/A
q
Search query as entered by the user.
See Query Terms for additional query features.
Default value: N/A
rc
Request an accurate result count for up to 1M documents. When rc = 1, the user will get accurate result count. This might introduce high latency. rc=0 works like current default search estimates, as described in Appendix A: Estimated vs. Actual Number of Results.
requiredfields
Restricts the search results to documents that contain the exact meta tag names or name-value pairs. See Meta Tags for more information.
Meta tag names or values must be double URL-encoded (see Appendix B: URL Encoding).
Default value: Empty string
secure_estimates
Retrieves estimates for secure searches if Show Per-Query Estimates is enabled on the Search > Search Features > Query Settings page in the Admin Console and the secure_estimates search parameter is set to 1 in the request:
site
Required parameter. Limits search results to the contents of the specified collection.
The following example uses the AND character:
&site=col1.col2
The following example uses the OR character:
&site=col1|col2
Query terms info, link and cache ignore collection restrictions that are specified by the site query parameter.
The site parameter is required for Advanced Search Reporting.
sitesearch
Limits search results to documents in the specified domain, host, or web directory. Has no effect if the q parameter is empty. This parameter has the same effect as the site special query term.
Unlike the as_sitesearch parameter, the sitesearch parameter is not affected by the as_dt parameter. The sitesearch and as_sitesearch parameters are handled differently in the XML results. The sitesearch parameter’s value is not appended to the search query in the results. The original query term is not modified when you use the sitesearch parameter. The specified value for this parameter must contain fewer than 125 characters.
Default value: Empty string
sort
Specifies a sorting method. Results can be sorted by date. (See Sorting for sort parameter format and details.)
Default value: Empty string
start
Specifies the index number of the first entry in the result set that is to be returned. Use this parameter and the num parameter (see num) to implement page navigation for search results. The index number of the results is 0-based. For example:
•
|
start=0, num=10, returns the first 10 results. These are returned by default if you do not specify values for start or num.
|
•
|
start=10, num=10, returns the next 10 results.
|
The maximum number of results available for a query is 1,000, i.e., the value of the start parameter added to the value of the num parameter cannot exceed 1,000.
tlen
Default value: 70 bytes
ud
Specifies whether results include ud tags. A ud tag contains internationalized domain name (IDN) encoding for a result URL. IDN encoding is a mechanism for including non-ASCII characters. When a ud tag is present, the search appliance uses its value to display the result URL, including non-ASCII characters.
The value of the ud parameter can be zero (0) or one (1):
•
|
A value of 0 excludes ud tags from the results.
|
•
|
A value of 1 includes ud tags in the results.
|
As an example, if the result URLs contain files whose names are in Chinese characters and the ud parameter is set to 1, the Chinese characters appear. If the ud parameter is set to 0, the Chinese characters are escaped.
•
|
When a search request includes the proxystylesheet parameter, the default value for ud is 1 and cannot be modified.
|
•
|
When the search request does not include the proxystylesheet parameter, the default value for ud is 0 and the value can be modified.
|
ulang
Note: A similar parameter, inlang, is for GSA internal use only.
wc
For example, the wildcard term go* expands into any word that begins with the pattern "go." If wc=3, then the search expands to include at most 3 expanded terms.
Default value: 200
wc_mc
•
|
For more information, see Wildcard Search.
Custom Parameters
In addition to the Search Parameters, you can also define custom parameters in a search request. The search appliance returns custom parameters and their values in the search results.
http://search.customer.com/search?q=customer+query
&site=collection
&client=collection
&output=xml_no_dtd
&myparam=test+this
The resulting XML output looks like this:
<param name="q" value="customer query" original_value="customer+query"/>
<param name="myparam" value="test_this" original_value="test+this" />
The unmodified value can be retrieved from the original_value attribute.
Query Terms
Star Wars Episode “I”
Special Characters: Query Term Separators
The following characters are exceptions:
Treated as a Boolean AND. |
|
Treated as part of a query term if there is no space preceding it. A hyphen that is preceded by a space is the Exclude Query Term operator. A hyphen after a parenthesis is treated as the Exclude Query Term operator. For example, the query Fmoc-Cys(Trt)-OH returns documents that contain Fmoc-Cys(Trt) and excludes documents that contain OH in addition to Fmoc-Cys(Trt). |
|
Treated as a query term separator unless it is part of a number (for example, 250.01). For example, dancing.parrot is equivalent to "dancing parrot" with quotes in the query. The term dancing.parrot is not equivalent to dancing parrot (without quotes). |
|
Treated as another character in the query term in which it is included. |
If a document contains a number, with or without a decimal point, that has letters immediately before or after it, the letters are treated as a separate word or words. For example, the string 802.11a is indexed as two separate words, 802.11 and a.
Note: An underscore (or under bar) is not a query term separator. For example, if you search for taino_the_parrot, the only valid search result is a document that contains the exact phrase, taino_the_parrot. A search for taino or parrot does not return the taino_the_parrot result.
Special Query Terms
Note: All query terms must be correctly URL-encoded in a search request (see Appendix B: URL Encoding).
Anchor text search
Restricts the search to pages that contain all the search terms that are specified in the anchor text in links to the page. For example, allinanchor:best museums sydney returns only pages in which the anchor text in links to the pages contain the words “best,” “museums,” and “sydney.” The following example shows an anchor tag:
<a href="http://foo.com"> museums </a>
allinanchor: evaluates the text between > and </a>. allinanchor: evaluates only <a href anchor tags. It does not evaluate <a name anchor tags.
Do not include any other search operators with the allinanchor: operator.
allinanchor:membership directory
Back Links
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.
The URL pattern for the linked-to web page must appear in Follow and Crawl URL patterns on the Content Sources > Web Crawl > Start and Block URLs page in the Admin Console. Otherwise, the link query does not produce any search results. For example, consider the following the query link:http//www.example.com/child.html. For this query to return any results, www.example.com/ must appear in Follow and Crawl URL patterns.
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 (see as_lq) can also be used to submit a link request.
The query term link: returns 25 results as default but you can configure this number by using the Search > Search Features > Query Settings page in the Admin Console.
link:www.google.com
Boolean OR Search
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 (see as_oq) can also be used to submit a search for any term in a set of terms.
For additional information on the use of OR, see “Usage Notes” in Using inmeta to Filter by Meta Tags.
vacation london OR paris
The OR operator takes precedence over the AND operator, so this example will be treated as:
vacation AND (london OR paris)
Cached Results Page
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. See also the site parameter (see site).
cache:www.google.com web
Date Range Search
Restrict search to documents with modification dates that fall within a time frame. You can search any dates between 1900-01-01 and 2079-06-06. For a complete list of date formats, see Acceptable Date Formats.
Date range searches by themselves do not return results and must be accompanied by a search term.
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, 2008 and December 24, 2008, enter the following statement:
parrot daterange:2008-08-01..2008-12-24
parrot daterange:..2008-08-08
parrot daterange:2009-01-01..
To specify how a search appliance sorts search results by document dates, use 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.
election daterange:2008-01-20..2009-01-20
election daterange:2008-01-20..
election daterange:..2009-01-20
parrot daterange:2452122-2452234
Directory Restricted Search
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.
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. You can specify one site term per search request or multiple site terms using the Boolean OR operator.
The search request parameters as_sitesearch (see as_sitesearch) and as_dt (see as_dt) can also be used to submit directory restricted searches. See also the site parameter (see site).
site:www.google.com
site:google.com
site:com
admission site:www.stanford.edu/group/uga
site:www.google.com/enterprise/
site:www.google.com/about
gxp site:www.corp.google.com/eng/howto OR site:www.corp.google.com/eng/doc
Exclusion
The search request parameter as_eq (see as_eq) can also be used to submit terms to exclude.
bass -music
File Extension Filtering
The query prefix ext: filters the results to include only documents with the specified file extension. No spaces can come between ext: and the type. For example, ext:pdf, which retrieves all documents with the pdf extension.
You can combine this prefix with the filetype prefix to construct the following types of query : filetype:pdf AND ext:pdf, which retrieves all documents with the Mime type pdf and with the pdf extension.
You can exclude file types by putting a minus sign before ext, such as -ext:pdf. For more information, see File Extension Exclusion.
whitepaper ext:doc OR ext:pdf
File Extension Exclusion
The query prefix-ext: filters the results to exclude documents with the specified file extension. No spaces can come between -ext: and the specified extension.
You can exclude multiple file types by adding more -ext: terms to the search query.
whitepaper -ext:pdf -ext:doc
File Type Filtering
The query prefix filetype: filters the results to include only documents with the specified MIME content type. No spaces can come between filetype: and the type.
You can exclude file types by putting a minus sign before filetype, such as -filetype:pdf. For more information, see File Type Exclusion.
See also as_filetype and as_ft for including and excluding documents from the search results.
You can specify multiple file types by adding filetype: terms to the search query, combined with the Boolean OR.
whitepaper filetype:doc OR filetype:pdf
File Type Exclusion
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.
whitepaper -filetype:doc
-filetype:pdf
Meta Tag Search
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.
inmeta:department=Human Resources
There is a 128 character limit for inmeta queries.
The 128 characters includes the inmeta term and metatag name/value:
inmeta:<name>=<value> => 128 characters in total.
See Meta Tags for more details.
Number Range Search
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.
pencils $1.50..$2.50
Phrase Search
You can also use the as_epq search request parameter (see as_epq) to submit a phrase search.
"yellow pages"
yellow-pages
Text Search (one term)
If you precede a query term with intext:, the search appliance restricts the search to documents that contain the search word in the titles or body text of the documents. The search appliance does not search for the query word in the metadata, anchors, or urls.
intext:google
Text Search (all terms)
If you precede a query term with allintext:, the search appliance restricts the search to documents whose titles or body text contains the search terms. The search appliance does not search for the query words in the metadata, anchors, or urls. Returns only documents that have the search terms in the title or body text of the document.
allintext:google search
Title Search (one term)
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.
For plain text files, the search appliance displays results using the first 70 KB of the file as the title. Because the document does not have a title, the intitle special query term does not work for plain text files.
intitle:google
Title Search (all terms)
If you precede a query with allintitle: Google search restricts the results to those with all of the query words in the result title.
For plain text files, the search appliance displays results using the first 70 KB of the file as the title. Because the document does not have a title, the allintitle special query term does not work for plain text files.
allintitle:google search
URL Search (one term)
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.
inurl:Google search
URL Search (all terms)
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.
allinurl: Google search
Web Document Info
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.
info:www.google.com
Wildcard Search
If you precede a query with wildcard:, you can search by entering a wildcard pattern instead of the exact spelling of a term. By default, wildcard search is enabled for each front end of the search appliance. However, to use wildcard search, you must ensure that wildcard indexing is also enabled for your search appliance by using the Index > Index Settings page in the Admin Console.
The search appliance supports two wildcard: operators:
The search appliance is able to consider all words with * as wildcard terms, so users don't need to prepend the wildcard: special operator to a pattern that contains this operator. To enable the search appliance to do this, click the Consider words with * as wildcards by default checkbox on the Search > Search Features > Front Ends > Filters page.
wildcard:test*
wildcard:?nter
Wildcard search is also supported for metadata queries, but the wildcard: special operator is omitted. For example: inmeta:name*. Also, metadata queries are %-encoded, which affects the form of an inmeta: wildcard query.
Wildcard search is not supported for other common queries, including filetype, inurl, intext, and so on. Also, wildcard search is not supported with Chinese, Japanese, Korean, or Thai.
Filtering
Google search provides many ways for you to filter the results that are returned from your search query. In addition to the automatic filtering and language filtering described in this section, the search appliance provides filtering by query parameters (see Search Parameters), query terms (see Query Terms) and meta tags (see Meta Tags), which are documented in their respective sections.
Automatic Filtering
Google uses automatic filtering to ensure the highest quality search results.
Google search uses two types of automatic filters:
•
|
Duplicate Snippet Filter—If multiple documents contain identical titles as well as the same information in their snippets in response to a query, only the most relevant document of that set is displayed in the results.
|
•
|
Duplicate Directory Filter—If there are many results in a single web directory, then only the two most relevant results for that directory are displayed. An output flag indicates that more results are available from that directory.
|
By default, both of these filters are enabled. You can disable or enable the filters by using the filter parameter settings as shown in the table.
When a search filter is enabled and removes some results, the search results output indicates that results were filtered. See Appendix A: Estimated vs. Actual Number of Results for more information about how a filtered result set is identified and for recommendations for displaying the results.
Although the filter=0 option exists, Google recommends against setting filter=0 for typical search requests, because filtering significantly enhances the quality of most search results.
For queries that contain the site special query term or the as_sitesearch query parameter, automatic filtering does not take place.
Language Filters
Automatic Language Filters
Note: Encoding schemes for the input and output of search requests are also important when you provide international search. For more information on encoding, see Internationalization. For more information on how language filtering works with Simplified Chinese and Traditional Chinese, see Language Filtering for Traditional and Simplified Chinese.
The automatic language filters are:
If you want to filter languages other than the above, obtain the language code from ISO 639 (see http://www.loc.gov/standards/iso639-2/php/code_list.php), index a document corpus containing the desired languages, and run tests to determine that the search results are as expected.
Language Filtering for Traditional and Simplified Chinese
Combining Language Filters
Search requests that use the lr parameter support the Boolean operators identified in the following table in order of precedence.
Removes all results that are defined as part of the Language Filter immediately following the - operator. The example lr value would remove all results in French. |
||
Returns results that are in the intersection of the results returned by the collection to either side of the dot operator. The example restrict value returns results which are in both the “hats” and “gloves” custom collections. |
||
Returns results that are in either of the results returned by the collection to either side of the pipe operator (|). The example lr value returns results matching the query that are in either French or English. |
||
All terms within the innermost set of parentheses are evaluated before terms outside the parentheses are evaluated. Use parentheses to adjust the order of term evaluation. The example lr value returns all results in the “gloves” custom collection that are not in either the Hungarian or Czech collections. |
Note: Spaces are not valid characters in the collection string.
Internationalization
To support searching documents in multiple languages and character encodings, Google provides the ie and oe parameters. The ie parameter indicates how to interpret characters in the search request. The oe parameter indicates how to encode characters in the search results. To appropriately decode the search query and correctly encode the search results, supply the correct ie and oe parameters, respectively, in the search request.
Note: When you are providing search for multiple languages, Google recommends using utf8 encoding value for the ie and oe parameters.
Examples
Example 1. The following search request interprets the search query “gloves” using latin1 encoding, searches for English or French results, and returns results using latin1 encoding:
GET /search?q=gloves&client=test&site=test&lr=lang_en|lang_fr&ie=latin1&oe=latin1
Example 2. This request interprets the search query “gloves” using latin2 encoding, searches for results which are not in Hungarian or Czech, and returns results using latin2 encoding:
GET /search?q=gloves&client=test&site=test&lr=(-lang_hu).(-lang_cs)&ie=latin2&oe=latin2
Example 3. This request interprets the search query “gloves” using utf8 encoding, searches for results which are in Simplified or Traditional Chinese, and returns results using utf8 encoding:
GET /search?q=gloves&client=test&site=test&lr=lang_zh-CN|lang_zh-TW&ie=utf8&oe=utf8
Note: For information on language-specific searches that use the lr parameter, see Language Filters.
Character Encoding Values
Here is a list of encoding values that can be used with the parameters ie and oe:
Sorting
Google search provides three sorting options for search results:
Sort By Relevance (Default)
Sort By Date
When using the sort-by-date feature, the built-in filter of duplicate directories and duplicate snippets will group the highest result (newest or oldest depending on the sort order) with similar results regardless of their date. This can be disabled by adding the filter=0 parameter to the search request when performing search by date.
Note: When sorting by date, the order of the results can also be effected by any relevant result biasing policies that are being used. See Using Result Biasing to Influence Result Ranking in Creating the Search Experience.
Example
GET /search?q=chicken+teriyaki&output=xml&client=test&site=test&sort=date:D:S:d1
Results are sorted by date and relevancy.
Details
To sort the results by date, include the sort parameter in the search request, formatted as follows:
date:<direction>:<mode>:<format>
The following tables shows the possible values for <direction>, <mode>, and <format>.
Return the date information for each result. No sorting is done. |
The format of the value returned for each search result is set to YYYY-MM-DD. |
Sort by Metadata
When sorting by metadata, the total length of the metadata attr:value pair cannot exceed 121 characters. Exceeding the maximum character limit causes results to be unsorted. For more information, see Meta Tags.
The value used to sort each document is available in the XML output in the FS tag.
How Sorting Works
•
|
Multivalued metadata—If you have specified certain meta tags as multivalued in Index > Index Settings, then only the first value in those tags is used for sorting.
|
•
|
Multiple meta tags with the given name—If a document has multiple meta tags with the given name, all of which have the exact same value, then that value will be used for sorting. If the multiple meta tags have different values, then none will be used and the document will behave as if it has no meta tag with the given name.
|
•
|
No meta tag with the given name for a document—If a document does not contain a meta tag with the given name, then it will be placed after documents that do have meta tags with the given name. All of these documents without such meta tag will be ordered by their original relevancy ranks.
|
•
|
Date—If a meta tag has been specified as a date in Index > Index Settings, then the value will be normalized into a YYYY-MM-DD format before being sorted.
|
Details
To sort results by metadata, include the sort parameter in the search request, formatted as follows:
meta:<name>:<direction>:<mode>:<language>:<case>:<numeric>
meta:<name>:::<language>
meta:<name>:::<language>::
The following tables show the possible values for the options.
The name of the meta tag that should be used to sort by. This string must be double-URL-encoded. |
A 2-character language code indicating the language rules to use to sort. en is the default. |
Sort lowercase version of a letter before the uppercase version of that letter. |
For more information about the language options, case options, and numeric options D and Y, see the ICU Collation documentation.
Examples
The following examples show sort parameters and how values would be sorted.
Sorting authors or other alphabetic values
Sort numbers that have the same format
This is a very fast option, if all the numbers are in the following formats.
Dates in word format are sorted alphabetically.
Meta Tags
There are no restrictions on the number of meta tag matches a results page can display.
The maximum number of characters for a metadata attr:value pair for the search request parameters requiredfields and partialfields and special query term inmeta is 121. If the combination of the metadata attr:value is bigger than 121 characters then those particular meta tag contents will be visible at serving time although not searchable via the search request. Also, it will not be visible in dynamic navigation.
Take note that if the metatada attr:value contains term values that have less than 121 characters, those terms may still be searchable via the partialfields request parameter and the inmeta special query term using the ~ operator (see the example below).
At search time, if the encoded value of the search attribute (requiredfields, partialfields, inmeta) plus the attr:value is greater than 121, then the search won't produce any results. For example, the following meta tag value is not searchable because the encoded value of the search attribute plus the combination of attr:value is greater than 121 characters:
<meta name="gamc"
content="123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890"/>
<meta name="gamc2" content="1234
123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890"/>
This section describes the following methods of using meta data:
•
|
•
|
Filtering by meta tags using the requiredfields or partialfields parameters (see Filtering by Meta Tags)
|
Requesting Meta Tag Values
Use the getfields parameter in a search request to specify meta tag values to return with the search results. The search engine returns only meta tag information for results that actually contain the meta tags. The search for meta tags is case-insensitive. Use only whole words in the getfields parameter, not partial words or word “stems.” There are limits to the number of characters returned for each meta tag when using getfields. The character limits include the meta tag name and content. These are the limits:
Usage
GET /search?q=[search term]&output=xml&client=test&site=test&getfields=[meta tag name]
Example
GET /search?q=books&output=xml&client=[test]&site=[test]&getfields=author.title.keywords
If any of the results contain the author, title or keywords meta tags, then the values of those meta tags are returned with the respective results. For example, the following tags could be returned with this search request:
<meta name="author" content="Jakob Nielsen">
<meta name="title" content="Usability Engineering">
<meta name="keywords" content="Usability, User Interface, User Feedback">
Details
To specify multiple meta tag values to be returned, list all meta tag names separated by a period (.) as in the first example. To request all available meta tags for each search result, specify an asterisk (*) as the value for the getfields parameter.
When meta tag values are requested, they are not displayed in results requested in the default HTML format. You can use the custom HTML or XML output options, or set the XSLT variable show_meta_tags to display meta tags in results. For more information, see Advanced Customization Topics in Creating the Search Experience.
All specified meta tag names and values must be double URL-encoded (see Appendix B: URL Encoding).
Filtering by Meta Tags
The search appliance can filter results by the values of the results’ meta tags. This section describes how to use the requiredfields and partialfields input parameters to filter results using meta tag values. You can use these parameters to include only search results that contain specified meta tag values.
The term partialfields refers to part of the meta tag content, rather than part of a word. For information on other filtering techniques, see Filtering.
You can use the operators in the following table when filtering by meta tags.
AND (.) |
|
OR (|) |
|
Exclude from the result set any results that contain the specified meta tag condition. |
Usage
GET /search?q=[search term]&output=xml
&client=test
&site=test
&requiredfields=[meta tag name]:[meta tag content]
The q= parameter is optional when using requiredfields or partialfields parameters, however, the whole query needs to have at least one positive term, be it part of the query or in the metadata restricts.
Examples
<META NAME="department" CONTENT="Human Resources">
<META NAME="department" CONTENT="Finance">
GET /search?q=checks&output=xml&client=test
&site=test
&requiredfields=department:Human%2520Resources|department:Finance
<META NAME="department" CONTENT="Engineering">
GET //search?q=checks&output=xml&client=test
&site=test
&requiredfields=-department:Engineering
<META NAME="author" CONTENT="Sir Walter Scott">
<META NAME="author" CONTENT="F. Scott Fitzgerald">
GET /search?q=books&output=xml
&client=test
&site=test
&partialfields=author:Scott
Details
Multiple meta tag constraints can be specified using the requiredfields and partialfields parameters. To filter for the presence of a meta tag, indicate the name of the meta tag to be found. To filter on a specific meta tag value, indicate the name of the meta tag followed by the colon “:” character and then the specific value. The partialfields parameter matches complete words, not parts of words.
To combine multiple name-value pairs, use the following Boolean operators.
Nested Boolean Filtering Using Meta Tags
Arbitrarily nested boolean queries can be written using requirefields and partialfields in conjunction with AND (.), OR (|), and NOT (-) operators. However, there is no way to specify range search with requirefields and partialfields, as noted. Nested boolean queries cannot be used with inmeta. Because precedence cannot be specified in the search box, when you use inmeta, the normal precedence operators take over and the query is executed. However, a single query can include both inmeta for range search and a nested boolean statement using requirefields and partialfields.
For example, consider the following query:
The following table contains examples of invalid queries.
Invalid because AND has 3 children (NOT a, NOT b, NOT c) and all are NOT’ed |
||
Searches with unsupported expressions are not performed and do not return results.
Non-Alphanumeric Characters
By default, non-alphanumeric characters in a partialfields query separate the query terms in the same way as space characters. Generally use spaces as separators even when the original content used different content as a separator. For example if you were trying to do a partialfields query for the following meta tag:
<meta name="part" content="aaa-bbb+ccc*ddd-fff">
partialfields=part:aaa%20bbb
partialfields=part:bbb%20ccc
The following non-alphanumeric characters are exceptions:
A double URL-encoded (see Appendix B: URL Encoding) decimal point can act as a decimal point in a number (for example, 250.01). For example to query for a meta tag like: <meta name="number" content="1.1222"> Use a partialfields query like: partialfields=number:1%252E1222 <meta name="pet" content="dancing.parrot"> Use a partialfields query like (%2520 is a double URL-encoded space character): partialfields=pet:dancing%2520parrot <meta name="serialnumber" content="A1.2" Use a partialfields query like: partialfields=serialnumber:A1%202 |
|
Not treated as a separator. For example for the meta tag: <meta name="letters" content="a&b"> Use a partialfields query like this (%2526 is a double URL-encoded ampersand character): partialfields=letters:a%2526b |
|
Not treated as a separator. For example for the meta tag: <meta name="letters" content="a_b"> Use a partialfields query like this: partialfields=letters:a_b\ |
Using inmeta to Filter by Meta Tags
The special query term inmeta provides meta tag filtering directly from the search box. In combination with simple operators, inmeta filters by meta tags in the same way as the requiredfields or partialfields search parameters. You can further refine inmeta filtering using the double-period (..) separator and the daterange query term to search by number and date range. (For more information, see Query Terms.)
The special query term inmeta and relevant search parameters map to each other in this way:
Returns only results that match the exact meta tag content value specified. |
||
2.
|
The OR keyword separating query terms in which a date or numeric range appears returns inconsistent results.
|
inmeta:TainoParrot6:1..244227 OR inmeta:TainoParrot6=244228
inmeta:TainoParrot6=244227 OR inmeta:TainoParrot6=244228
empty OR inmeta:TainoParrot6:244227..244229
empty OR inmeta:TainoParrot6=244228
yvette OR inmeta:TainoParrot6:1..244228
3.
|
4.
|
An inmeta search for a number range returns results only when a number contains six or fewer digits.
|
5.
|
An inmeta search for a number range is unable to handle negative numbers and ignores them.
|
6.
|
An inmeta search is unable to search by multiple keywords or perform phrase searches.
|
<meta name="department" content="Human Resources">
<meta name="department" content="Finance">
checks inmeta:department=Human+Resources+OR+checks inmeta:department=Finance
inmeta:department~Human OR inmeta:department~Finance
8.
|
An inmeta search of meta text with special characters, such as “.” and using the operator “~” doesn’t work, but using operator “=” with the full meta text does work.
|
9.
|
10.
|
<meta name="Author" content="Polly Hedra"></meta>
<meta name="Keywords" content="Resume"></meta>
<meta name="last saved by" content="Ray Polanco"></meta>
<meta name="revision number" content="1"></meta>
<meta name="last print date" content="5/27/2009 14:03:00"></meta>
<meta name="creation date" content="4/27/2009 13:15:00"></meta>
<meta name="Last Saved Date" content="4/27/2009 13:44:00"></meta>
<meta name="template" content="Taino Parrot Resume Template.dotx"></meta>
<meta name="edit minutes" content="23"></meta>
<meta name="page count" content="3"></meta>
<meta name="word count" content="220"></meta>
<meta name="character count" content="1512"></meta>
<meta name="source" content="Microsoft Office Word"></meta>
<meta name="security" content="0"></meta>
<meta name="Count Lines" content="12"></meta>
<meta name="Count Paragraphs" content="3"></meta>
<meta name="Scale Crop" content="no"></meta>
<meta name="company" content="Coqui Parrot Inc."></meta>
<meta name="links up to date" content="no"></meta>
<meta name="Count Characters with Space" content="1729"></meta>
<meta name="shared doc" content="no"></meta>
<meta name="Links Dirty" content="no"></meta>
<meta name="Application Version" content="12.0000"></meta>
<metadata>
<meta name="Name" content="Jenny Wong"/>
<meta name="Phone" content="x12345"/>
<meta name="Phone" content="x789"/>
<meta name="Floor" content="3"/>
12.
|
While inmeta supports wildcard search, it does not support boolean logic. Use requiredfields instead to combine wildcard search and boolean logic.
|
Examples
<html>
<head>
<title>My Title</title>
<meta name="myFloat" content="1.23456">
<meta name="myInteger" content="8" />
<meta name="myCurrency" content="123.45" />
<meta name="myDate" content="2011-03-05" />
</head>
<body>
Hello world.
</body>
</html>
The following search request is for a match to the lower bound value within the currency range:
inmeta:mycurrency:60.00999..
The following search request is for an exact match to the float value:
inmeta:myfloat:1.23456..1.23456
The following search request is for an exact match to a date or date range:
inmeta:mydate:2011-03-05..2011-03-05
- or -
inmeta:mydate:daterange:2011-03-05..2011-03-05
<meta name="author" content="Sir Walter Scott">
<meta name="author" content="F. Scott Fitzgerald">
books inmeta:author~Scott
flat+panel+TV inmeta:size:30..50
Monica inmeta:date:daterange:2007-01-01..
Limitations
For information about search request limitations, see Specifications and Usage Limits.