public override void Execute(WorkContext context)
{
var keysToRemove = new HashSet<string>(StringComparer.OrdinalIgnoreCase);
try
{
context.TransactionalStorage.Batch(accessor =>
{
keysToRemove = new HashSet<string>(Keys.Where(key=>FilterDocuments(context, accessor, key)));
accessor.Indexing.TouchIndexEtag(Index);
});
if (keysToRemove.Count == 0)
return;
context.IndexStorage.RemoveFromIndex(Index, keysToRemove.ToArray(), context);
}
finally
{
context.MarkAsRemovedFromIndex(keysToRemove);
}
}