protected override void PerformRebuild(IndexingOptions indexingOptions, CancellationToken cancellationToken) { if (!ShouldStartIndexing(indexingOptions)) { return; } if (SwitchOnRebuild) { DoRebuild(indexingOptions); ISearchService searchService = SearchService; EventRaiser.RaiseRebuildEndEvent(new SwitchOnRebuildEventRemote() { IndexName = Name, SearchCloudIndexName = SearchCloudIndexName, RebuildCloudIndexName = RebuildCloudIndexName }); Thread.Sleep(OldIndexCleanUpDelay); searchService.Cleanup(); } else { Reset(); DoRebuild(indexingOptions); } }