beautypg.com

Freshness tuning – Google Search Appliance Administrative API Developers Guide: Java User Manual

Page 16

background image

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

16

Updating the Host Load Schedule

Update the host load schedule setting in a search appliance as follows:

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

// Add a property for the Host Load Schedule to updateEntry
updateEntry.addGsaContent("defaultHostLoad", "2.4");
updateEntry.addGsaContent("exceptionHostLoad",

"* 3 5 1.2 \n www.example.com 1 6 3.6");

updateEntry.addGsaContent("maxURLs", "3000");

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

Freshness Tuning

Increase or decrease the crawling frequency by specifying URL patterns.

Retrieving the Freshness Configuration

Retrieve the freshness tuning configuration as follows:

GsaEntry myEntry = myClient.getEntry("config", "freshness");
System.out.println("Archive URLs: " + myEntry.getGsaContent("archiveURLs"));
System.out.println("Frequent URLs: " + myEntry.getGsaContent("frequentURLs"));
System.out.println("Force URLs: " + myEntry.getGsaContent("forceURLs"));

Updating the Freshness Configuration

Update the settings for freshness tuning as follows:

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

// Add a property for updateEntry
updateEntry.addGsaContent("archiveURLs", "http://good/");
updateEntry.addGsaContent("frequentURLs", "http://frequent/");
updateEntry.addGsaContent("forceURLs", "http://force/");

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

Property

Description

archiveURLs

URL patterns for pages that contain archival or rarely changing content.

forceURLs

URL patterns for pages to recrawl regardless of their response to
If-Modified-Since request headers.

frequentURLs

URL patterns for pages that change often (typically more than once a day).