beautypg.com

Reset index, Retrieving content statistics for a crawled file, Retrieving status of a reset index – Google Search Appliance Administrative API Developers Guide: .NET User Manual

Page 30

background image

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

30

A list of content statistics entries are returned.

GsaFeed myFeed = myService.GetFeed("contentStatistics");
foreach(GsaEntry entry in myFeed.Entries) {

Console.WriteLine("Entry Name: " + entry.GetGsaContent("entryID"));
Console.WriteLine("Maximum Size: " + entry.GetGsaContent("maxSize"));
Console.WriteLine("Minimum Size: " + entry.GetGsaContent("minSize"));
Console.WriteLine("Total Size: " + entry.GetGsaContent("totalSize"));
Console.WriteLine("Average Size: " + entry.GetGsaContent("avgSize"));
Console.WriteLine("Number of Files: " + entry.GetGsaContent("numFiles"));

}

Retrieving Content Statistics For a Crawled File

Retrieve content statistics for a single crawled file by sending an authenticated GET request to a content
statistics entry of the contentStatistics feed.

The following content statistics for a crawled file are returned:

GsaEntry entry = myService.GetEntry("contentStatistics", "text/html");
Console.WriteLine("Maximum Size: " + entry.GetGsaContent("maxSize"));
Console.WriteLine("Minimum Size: " + entry.GetGsaContent("minSize"));
Console.WriteLine("Total Size: " + entry.GetGsaContent("totalSize"));
Console.WriteLine("Average Size: " + entry.GetGsaContent("avgSize"));
Console.WriteLine("Number of Files: " + entry.GetGsaContent("numFiles"));

Reset Index

Reset the index for a search appliance using the following properties.

WARNING:

Resetting an index deletes all the documents in the index. Depending on the number of

documents to crawl, crawling an index can take many days to complete.

Retrieving Status of a Reset Index

Retrieve the status of a reset index as follows:

// Send the request and print the response
GsaEntry myEntry = myService.GetEntry("command", "resetIndex");
Console.WriteLine("Reset Index: " + myEntry.GetGsaContent("resetIndex"));
Console.WriteLine("Reset Status Code: " + myEntry.GetGsaContent

("resetStatusCode"));

Console.WriteLine("Reset Status Message: " + myEntry.GetGsaContent

("resetStatusMessage"));

Property

Description

resetIndex

1 if index is reset, 0 if index is not reset.

resetStatusCode

Status code for resetting index.

resetStatusMessage

Status message: ERROR, PROGRESS, READY.