Skip to content

Instantly share code, notes, and snippets.

@martinrayenglish
Created August 22, 2020 13:05
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save martinrayenglish/650def65b096ef0e00c1b3d9d001a056 to your computer and use it in GitHub Desktop.
Save martinrayenglish/650def65b096ef0e00c1b3d9d001a056 to your computer and use it in GitHub Desktop.
using System.Collections.Generic;
using System.Threading.Tasks;
using Sitecore.Xdb.Collection;
using Sitecore.Xdb.Collection.Indexing;
using Sitecore.Xdb.Collection.Model;
namespace Test.SCExtensions.Xdb.Collection.Search.Solr
{
public sealed class IndexRebuilderFilterDecorator : IIndexRebuilder
{
private readonly IIndexRebuilder _inner;
public IndexRebuilderFilterDecorator(IIndexRebuilder inner)
{
this._inner = inner;
}
public Task BeginRebuild()
{
return this._inner.BeginRebuild();
}
public Task CompleteRebuild(ISyncToken syncToken)
{
return this._inner.CompleteRebuild(syncToken);
}
public async Task WriteDataBatch(ChangedDataRecords changedDataRecordsBatch)
{
ChangedDataRecords filteredChanges = new ChangedDataRecords(changedDataRecordsBatch.get_ContactRecords(), (IReadOnlyCollection<InteractionDataRecord>) new List<InteractionDataRecord>().AsReadOnly(), changedDataRecordsBatch.get_DeletedContactIds(), changedDataRecordsBatch.get_DeletedInteractionIds());
await this._inner.WriteDataBatch(filteredChanges).ConfigureAwait(false);
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment