protected override IEnumerable <ContactIdentifiersData> GetContactIdentifiers() { this.Logger.Info($"Retrieveing all contact id's from '{this.AnalyticsMongoConnectionString}' collection database.", this); var driver = MongoDbDriver.FromConnectionString(this.AnalyticsMongoConnectionString); return(driver.Contacts.FindAllAs <ContactIdentifiersData>()); }
public override IEnumerable <VisitData> GetVisitDataToReindex() { return(this.SafeExecution($"Retrieveing all visit data from '{this.AnalyticsMongoConnectionString}' collection database.", () => { var driver = MongoDbDriver.FromConnectionString(this.AnalyticsMongoConnectionString); return driver.Interactions.FindAllAs <VisitData>(); })); }
protected void btnRebuild_OnClick(object sender, EventArgs e) { ContentSearchManager.GetIndex("sitecore_analytics_index").Reset(); var poolPath = "aggregationProcessing/processingPools/live"; var pool = Factory.CreateObject(poolPath, true) as ProcessingPool; var driver = MongoDbDriver.FromConnectionString("analytics"); var visitorData = driver.Interactions.FindAllAs <VisitData>(); var keys = visitorData.Select(data => new InteractionKey(data.ContactId, data.InteractionId)); foreach (var key in keys) { var poolItem = new ProcessingPoolItem(key.ToByteArray()); pool?.Add(poolItem); } }
public void RebuildAnalyticsIndex() { using (new SecurityDisabler()) { ContentSearchManager.GetAnalyticsIndex().Reset(); var poolPath = "aggregationProcessing/processingPools/live"; var pool = Factory.CreateObject(poolPath, true) as ProcessingPool; var beforeRebuild = pool.GetCurrentStatus().ItemsPending; var driver = MongoDbDriver.FromConnectionString("analytics"); var visitorData = driver.Interactions.FindAllAs <VisitData>(); var keys = visitorData.Select(data => new InteractionKey(data.ContactId, data.InteractionId)); foreach (var key in keys) { var poolItem = new ProcessingPoolItem(key.ToByteArray()); pool.Add(poolItem); } } }