Ichaber\SSSwiftype\Extensions\SwiftypeSiteTreeCrawlerExtension
Class SwiftypeSiteTreeCrawlerExtension
Synopsis
class SwiftypeSiteTreeCrawlerExtension
extends SiteTreeExtension
{
- // members
- private array $urlsToCrawl = ;
- // methods
- public void setUrlsToCrawl()
- public array getUrlsToCrawl()
- public void onBeforeWrite()
- public void onAfterPublish()
- public void onBeforeUnpublish()
- public void onAfterUnpublish()
- public void clearCacheAll()
- public void clearCacheSingle()
- public void collateUrls()
- protected void processCollatedUrls()
- protected bool forceSwiftypeIndex()
- protected string getOwnerKey()
- private void withVersionContext()
Hierarchy
Extends
- SilverStripe\CMS\Model\SiteTreeExtension
Members
private
- $urlsToCrawl
—
array
Urls to crawl
Methods
private
- withVersionContext() — Sets the version context to Live as that's what crawlers will (normally) see
protected
- forceSwiftypeIndex()
- getOwnerKey()
- processCollatedUrls() — Send requests to Swiftype to reindex each of the Urls that we have previously collated
public
- clearCacheAll() — You may need to clear the cache at some point during your particular process
- clearCacheSingle() — You may need to clear the cache at some point during your particular process
- collateUrls() — Collate Urls to crawl
- getUrlsToCrawl()
- onAfterPublish() — After a publish has occurred, we can collate and process immediately (no need to split things out like during an unpublish)
- onAfterUnpublish() — After the unpublish has completed, we can now request Swiftype to reindex the Urls that we collated
- onBeforeUnpublish() — We need to collate the Urls to be purged *before* we complete the unpublish action (otherwise, the LIVE Urls will no longer be available, since the page is now unpublished)
- onBeforeWrite() — We need to collate Urls before we write, just in case an author has changed the Page's Url Segment. If they have, then we need to request Swiftype to reindex both the old Url (which should then be marked by Swiftype as a 404), and the new Url
- setUrlsToCrawl()