beautypg.com

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

Page 16

background image

Google Search Appliance: Administrative API Developer’s Guide: .NET

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
myService.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 = myService.GetEntry("config", "freshness");
Console.WriteLine("Archive URLs: " + myEntry.GetGsaContent("archiveURLs"));
Console.WriteLine("Frequent URLs: " + myEntry.GetGsaContent("frequentURLs"));
Console.WriteLine("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
myService.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).