beautypg.com

Retrieving data source feed information, Deleting data source feeds – Google Search Appliance Administrative API Developers Guide: .NET User Manual

Page 10

background image

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

10

Retrieving Data Source Feed Information

Retrieve all data source feed information from a search appliance using the feed feed:

// Send a request and print the response
Dictionary queries = new Dictionary();
queries.Add("query",feedDataSource);
GsaFeed myFeed = myService.QueryFeed("feed", queries);

foreach(GsaEntry myEntry in myFeed.Entries) {

//get information on each myEntry
Console.WriteLine("Feed Name: " + myEntry.GetGsaContent("entryID"));
Console.WriteLine("Feed Data Source: " + myEntry.GetGsaContent

("feedDataSource"));

Console.WriteLine("Feed Type: " + myEntry.GetGsaContent("feedType"));
Console.WriteLine("Feed State: " + myEntry.GetGsaContent("feedState"));
Console.WriteLine("Feed Time: " + myEntry.GetGsaContent("feedTime"));
Console.WriteLine("Error Records: " + myEntry.GetGsaContent("errorRecords"));
Console.WriteLine("Success Records: " + myEntry.GetGsaContent

("successRecords"));

Console.WriteLine("Log Content: " + myEntry.GetGsaContent("logContent"));

}

You can get the individual feed information from a search appliance as follows:

GsaEntry myEntry = myService.GetEntry("feed", FEED_NAME);
Console.WriteLine("Feed Data Source: " + myEntry.GetGsaContent
("feedDataSource"));
Console.WriteLine("Feed Type: " + myEntry.GetGsaContent("feedType"));
Console.WriteLine("Feed State: " + myEntry.GetGsaContent("feedState"));
Console.WriteLine("Feed Time: " + myEntry.GetGsaContent("feedTime"));
Console.WriteLine("Error Records: " + myEntry.GetGsaContent("errorRecords"));
Console.WriteLine("Success Records: " + myEntry.GetGsaContent("successRecords"));
Console.WriteLine("Log Content: " + myEntry.GetGsaContent("logContent"));

Note: A feed log of all data source feeds can be retrieved only by getting individual feeds.

Deleting Data Source Feeds

Delete a data source feed to remove all documents for a feed from the index on the search appliance. In
the Admin Console, deleted feed sources are marked with Delete.

Delete data source feeds as follows:

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

// Add a property to updateEntry
updateEntry.AddGsaContent("updateMethod", "delete");
myService.UpdateEntry("feed", FEED_NAME, updateEntry);

Note: Delete data source feeds only of the type FULL_FEED or incremental. After deleting a data source
feed, the deleted feed still exists, and the feed type changes to DELETED.