beautypg.com

Reset index, Retrieving content statistics for a crawled file – Google Search Appliance Administrative API Developers Guide: Java User Manual

Page 29

background image

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

29

Common query parameters for all requests:

Content statistics entry properties:

Retrieving Content Statistics For All Crawled Files

Retrieve content statistics for all crawled files in a search appliance by sending an authenticated GET
request to the root entry of the contentStatistics feed.

A list of content statistics entries are returned.

GsaFeed myFeed = myClient.getFeed("contentStatistics");
for(GsaEntry entry : myFeed.getEntries()) {

System.out.println("Entry Name: " + entry.getGsaContent("entryID"));
System.out.println("Maximum Size: " + entry.getGsaContent("maxSize"));
System.out.println("Minimum Size: " + entry.getGsaContent("minSize"));
System.out.println("Total Size: " + entry.getGsaContent("totalSize"));
System.out.println("Average Size: " + entry.getGsaContent("avgSize"));
System.out.println("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 = myClient.getEntry("contentStatistics", "text/html");
System.out.println("Maximum Size: " + entry.getGsaContent("maxSize"));
System.out.println("Minimum Size: " + entry.getGsaContent("minSize"));
System.out.println("Total Size: " + entry.getGsaContent("totalSize"));
System.out.println("Average Size: " + entry.getGsaContent("avgSize"));
System.out.println("Number of Files: " + entry.getGsaContent("numFiles"));

Reset Index

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

Parameter

Description

collectionName

Name of the collection for which you want to view content statistics.

Property

Description

avgSize

The average document size for this content type.

Entry Name

The MIME type of the documents, such as, plain/text.

maxSize

The maximum document size for the crawled files with this MIME type.

minSize

The minimum document size for the crawled files with this MIME type.

numFiles

The total number of crawled files for this MIME type.

totalSize

The total size of all crawled files for this MIME type.