beautypg.com

Rich output format – Google Search Appliance Protocol Reference User Manual

Page 99

background image

Google Search Appliance: Search Protocol Reference

Query Suggestion Service /suggest Protocol

99

Response:

[

"",
[ "", "", ... "" ],
[ "", "", ..., "" ],
[ "", "", ..., "" ]

]

The client distinguishes between suggest and user-added results as follows:

For suggest results, the term is non-empty while the content and the URL are empty.

For user-added results, the term is empty, content is optional, and the URL is non-empty.

A client can choose to display both suggest and user-added results or just one of them. The default
front end provided in the Admin Console’s XSLT stylesheet, displays both results. User-added results
display after suggest results and appear in italics.

If no result occurs, the OpenSearch format provides the following response:

[ , [] ]

Rich Output Format

The rich format uses the rich protocol for search-as-you-type suggestions.

Parameter

Description

Default Value

callback

Provides a JSONP compatible response from suggest. If you
set callback=test, it will return:

/* GSA Suggest Service JSONP Response. */
test();

The prefix

/* GSA Suggest Service JSONP Response. */

is

hard-coded in the response to safeguard against cross-site
scripting attacks on the JSONP callback name. You must
remove the prefix before the response can be parsed by
JavaScript.

client

Front end name.

default_frontend

format

The output format in which the client wants the results.

rich

max

The maximum number of results that the suggest server
should return. The minimum is 0, which indicates that the
server should return an empty set, however this result
would not be meaningful.

The maximum is not defined. If this parameter is not set,
then the default value is 10 possible matches. If fewer
suggestions are configured, then they are returned.

10 (matches)