Front ends: remove urls and a relative onebox, Updating remove urls and a relative onebox – Google Search Appliance Administrative API Developers Guide: Java User Manual
Page 31
Google Search Appliance: Administrative API Developer’s Guide: Java
31
Front Ends: Remove URLs and a Relative OneBox
Retrieve, update, insert, or delete front ends to remove URLs or a relative OneBox for the search
appliance using the frontend feed. Retrieve a front end using the following properties.
Retrieving Front Ends, Remove URLs, and a Relative OneBox
Retrieve all the front end information for a search appliance as follows:
// Send a request and print the response
GsaFeed myFeed = myClient.getFeed("frontend");
for(GsaEntry myEntry : myFeed.getEntries()) {
//get information for each myEntry
}
Get information about a front end as follows:
// Send a request and print the response
GsaEntry myEntry = myClient.getEntry("frontend", FRONTEND_NAME);
System.out.println("Front End OneBox: " +
myEntry.getGsaContent("frontendOnebox"));
System.out.println("Remove URLs: " + myEntry.getGsaContent("removeUrls"));
Updating Remove URLs and a Relative OneBox
Update the URLs to remove from the search results, and update a OneBox module in a front end as
follows:
// Create an entry to hold properties to update
GsaEntry updateEntry = new GsaEntry();
// Add properties to updateEntry
updateEntry.addGsaContent("frontendOnebox", "oneboxtwo");
updateEntry.addGsaContent("removeUrls", "http://www.example.com/");
// Send the request
myClient.updateEntry("frontend", FRONTEND_NAME, updateEntry);
Property
Description
frontendOnebox
OneBox Modules that are relative to this front end. This value is a comma-
separated list of OneBox names. The OneBox modules are triggered for this
front end in the order that you specify.
removeUrls
Remove URLs that are relative to this front end. These are URL patterns that you
do not want to appear in the search results for this front end.