private void RebuildIndex(ISearchIndex index, bool isRemoteIndex = false) { if (IndexCustodian.IsRebuilding(index)) { WriteVerbose($"Skipping full index rebuild for {index.Name} because it's already running."); var job = Sitecore.Jobs.JobManager.GetJob($"{"Index_Update"}_IndexName={index.Name}"); if (job == null || !AsJob) { return; } WriteVerbose($"Background job existed: {job.Name}"); WriteObject(job); } else { WriteVerbose($"Starting full index rebuild for {index.Name}."); var job = (isRemoteIndex) ? IndexCustodian.FullRebuildRemote(index) : IndexCustodian.FullRebuild(index); if (job == null || !AsJob) { return; } WriteVerbose($"Background job created: {job.Name}"); WriteObject(job); } }
public void Run() { CrawlingLog.Log.Debug($"[Index={this.index.Name}] RemoteRebuildStrategy triggered.", null); IndexCustodian.FullRebuildRemote(this.index, true); }
public IJob FullRebuild(ISearchIndex index, bool isRemote) { var job = (isRemote) ? IndexCustodian.FullRebuildRemote(index) : IndexCustodian.FullRebuild(index); return(job == null ? null : new SpeJob(job)); }