beautypg.com

Listing a search report, Creating a search report – Google Search Appliance Administrative API Developers Guide: Java User Manual

Page 43

background image

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

43

Listing a Search Report

List search report entries by sending an authenticated GET request to the root entry of the
searchReport feed. Query parameter:

A list of search report entries returns:

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

System.out.println("Entry Name: " + entry.getGsaContent("entryID"));
System.out.println("Report State: " + entry.getGsaContent("reportState"));
System.out.println("Report Creation Date: " +

entry.getGsaContent("reportCreationDate"));

System.out.println("Report Date: " + entry.getGsaContent("reportDate"));
System.out.println("Is Final: " + entry.getGsaContent("isFinal"));
System.out.println("With Results: " + entry.getGsaContent("withResults"));
System.out.println("Top Count: " + entry.getGsaContent("topCount"));
System.out.println("Diagnostic Terms: " +

entry.getGsaContent("diagnosticTerms"));

}

Creating a Search Report

Create a new search report entry by sending an authenticated POST request to the root entry of the
searchReport feed.

The possible date formats for reports are as follows.

For example to specify the range of dates from 2 January 2009 to 23 September 2009, use this
statement:

insertEntry.addGsaContent("reportDate", "range_1_2_2009_9_23_2009");

topCount

The number of top queries to generate.

withResults

Indicates if a query should only count searches that have results. The
default value is false.

Parameter

Description

collectionName

Collection Name of search report. The default value is all.collections.

Purpose

Format

Date

date

_month_day_year

Month

month

_month_year

Year

year

_year

Date range

range

_month_day_year_month_day_year

Property

Description