beautypg.com

Query suggestion javascript variables, Ss_allow_non_query, Ss_form_element – Google Search Appliance Protocol Reference User Manual

Page 94

background image

Google Search Appliance: Search Protocol Reference

Query Suggestion Service /suggest Protocol

94

Queries with

Special Query Terms

, such as inmeta, are excluded from the Query Suggestion database.

So if this type of query is used extensively, then a possible solution is to use the equivalent

Search

Parameters

, such as partialfields and requiredfields.

After enabling query suggestions:

1.

The search appliance sets the XSLT stylesheet element show_suggest element:

1

2.

The search appliance provides access to the http://Search_Appliance/ss.js JavaScript file. The
ss.js file is for version 6.2 and later only, the version 6.0 uses the suggest_js.js file.

3.

When a user starts a query, the JavaScript in the client makes calls to the query suggestion URI and
fetches the results, responding with JSON output. The A JAX response handler in the JavaScript client
populates the list of suggestions.

For more information, see “Providing Query Suggestions” in Creating the Search Experience.

Query Suggestion JavaScript Variables

After enabling query suggestion, the show_suggest XSLT variable is set to 1 and the JavaScript variables
become usable in the XSLT stylesheet.

1

The query suggestion features supports the following JavaScript variables in the XSLT stylesheet.

ss_allow_non_query

A true or false flag used by the os (OpenSearch) and rich output formats to suppress user-added
results. This variable eliminates user-added results from the suggestions, while retains those based on
popularity among other users’ queries.

Default value: true

ss_form_element

The value of the attribute id of the

used for the search box. This variable must be overwritten
with the correct value when using suggest in a custom form outside of the search appliance, but still
using the existing JavaScript client. If this parameter is incorrect, A JAX calls aren’t sent.

The XSLT spreadsheet sets this variable as:

var ss_form_element = ’suggestion_form’;

The form request occurs under the following XSLT condition (wrapped for readability):

or ($type = ’std_top’))">
<form id="suggestion_form"

name="gs" method="GET" action="search"
onsubmit="return (this.q.value == ’’) ? false : true;"

Default value: suggestion_form