Creating a trigger, Triggering on every query – Google Search Appliance OneBox for Enterprise Developers Guide User Manual

Page 9

Advertising
background image

Google Search Appliance: Google OneBox for Enterprise Developer’s Guide

9

3.

Give the module a <name> (see the element “name” on page 23) and <description> (see the
element “description” on page 24). The name references the OneBox module on the outbound call
from the search appliance. The description explains the module’s functionality to search appliance
administrators and appears in the Admin Console.

<?xml version="1.0" encoding="UTF-8"?>
<GoogleEnterpriseSources xmlns:xsl="http://www.w3.org/1999/XSL/Transform">

<onebox type="external">

<name>directory_example</name>
<description>This sample OneBox queries a phone directory</description>
...

</onebox>

</GoogleEnterpriseSources>

Next, create a trigger as described in “Creating a Trigger” on page 9.

Creating a Trigger

A trigger determines which search queries invoke a OneBox module. A trigger can be a keyword, type of
phrase, or a regular expression. You specify the module’s keyword in the trigger element. The format
of the trigger element is as follows:

<trigger triggerType="when_to_trigger">trigger_word</trigger>

You can define a trigger in the XML configuration file or by creating and editing a OneBox in the Admin
Console.

The table below lists the triggerType attribute values.

The trigger element is optional. If you omit a trigger, the OneBox module invokes on every query.

Triggering on Every Query

If you have a high-bandwidth provider and network and query traffic is not a concern, the search
appliance can invoke a module on every query. In that case, a provider must determine whether the
module should return results to the user. You can achieve the best user experience by returning
OneBox results only when they enhance a user’s overall search results.

Attribute

Description

Example

null

Invoke trigger on
every query.

<trigger triggerType="null"></trigger>

keyword

Invoke in response
to one or more
keywords. Specify
keyword as the
value of the
element.

<trigger triggerType="keyword">directory</trigger>

regex

Invoke when a
query matches a
regular expression.

<trigger triggerType="regex">directory (.*)</trigger>

Advertising