beautypg.com

Onebox module retrieve and delete, Updating onebox module settings, Retrieving onebox module information – Google Search Appliance Administrative API Developers Guide: Java User Manual

Page 19

background image

Google Search Appliance: Administrative API Developer’s Guide: Java

19

The properties for retrieving a OneBox are as follows:

Updating OneBox Module Settings

Update the OneBox settings for a search appliance as follows—in this example three results are
requested and the timeout is set to 2000 milliseconds.

// Create an entry to hold properties to update
GsaEntry updateEntry = new GsaEntry();

// Add properties for the OneBox settings to updateEntry
updateEntry.addGsaContent("maxResults", "3");
updateEntry.addGsaContent("timeout", "2000");

// Send the request
myClient.updateEntry("config", "oneboxSetting", updateEntry);

OneBox Module Retrieve and Delete

Retrieve and delete OneBox modules from the search appliance using the onebox feed.

Note: Inserting a new OneBox module, updating an existing OneBox module, and retrieving a detailed
configuration of a OneBox module are not supported by this API.

Retrieving OneBox Module Information

Retrieve information about all the OneBox modules from a search appliance using the onebox feed:

// Send the request and print the response
GsaFeed myFeed = myClient.getFeed("onebox");

for(GsaEntry myEntry : myFeed.getEntries()) {

// Get information on each myEntry
System.out.println("OneBox Name: " + myEntry.getGsaContent("entryID"));

}

Note: Because detailed information about the OneBox configuration not supported by this API, the
onebox feed provides only OneBox module names.

Property

Description

maxResults

Maximum number of results.

timeout

OneBox response timeout in milliseconds.

Property

Description

logContent

The logs content of OneBox logs.