Google Search Appliance: Search Protocol Reference Request Format 8
Submitting a Search Request
Typically, search users make search requests by entering search parameters in a HTML form rendered in
a web browser (like the following):
<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>
Such forms are the most recognizable methods for generating GET requests, but there are numerous
other ways. For example, a web page may include a direct link that brings users to a page of search
results:
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
Each of these examples results in the same GET request. The HTTP response to this request contains
the first page of search results for the query “query string”, restricted to URLs in the collection named
“default_collection.” The results are rendered into HTML format using the XSL stylesheet associated with
the front end named “default_frontend”.
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
Explanation:
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
Commenti su questo manuale