This API lets you speak to the Google Search Appliance's (GSA) feeding API and manage items on indexes either incrementally or as a whole.
use com\google\gsa\feed\XmlFeed;
use com\google\gsa\feed\FeedType;
use com\google\gsa\feed\ContentRecord;
use com\google\gsa\feed\FeedConnection;
use com\google\gsa\feed\FeedPublishingException;
$feed= new XmlFeed($this->getClass()->getSimpleName(), FeedType::$INCREMENTAL);
foreach ($records as $record) {
$feed->addRecord('add', new ContentRecord($record['url'], 'text/html',
'<html><head>'.
'<title>'.$record['title'].'</title>'.
'</head><body>'.
$record['body'].
'</body></html>'
));
}
try {
(new FeedConnection('http://gsa-test01.example.com:19900/xmlfeed'))->publish($feed);
} catch (FeedPublishingException $e) {
// Handle
}
$ xp -r com.google.gsa.feed
@FileSystemCL<...\xp\gsa-xmlfeed\src\main\php\>
@FileSystemCL<...\xp\gsa-xmlfeed\src\test\php\>
package com.google.gsa.feed {
package com.google.gsa.feed.unittest
public enum com.google.gsa.feed.FeedType
public abstract class com.google.gsa.feed.Record
public class com.google.gsa.feed.ContentRecord
public class com.google.gsa.feed.FeedConnection
public class com.google.gsa.feed.FeedPublishingException
public class com.google.gsa.feed.UrlRecord
public class com.google.gsa.feed.XmlFeed
}