public Task WriteIndexAsync(IEnumerable <SnTerm> deletions, IEnumerable <DocumentUpdate> updates, IEnumerable <IndexDocument> additions, CancellationToken cancellationToken) { if (deletions != null) { foreach (var term in deletions) { Index.Delete(term); } } if (updates != null) { foreach (var update in updates) { Index.Update(update.UpdateTerm, update.Document); } } if (additions != null) { foreach (var doc in additions) { Index.AddDocument(doc); } } return(Task.CompletedTask); }
public void WriteIndex(IEnumerable <SnTerm> deletions, IEnumerable <DocumentUpdate> updates, IEnumerable <IndexDocument> additions) { if (deletions != null) { foreach (var term in deletions) { Index.Delete(term); } } if (updates != null) { foreach (var update in updates) { Index.Update(update.UpdateTerm, update.Document); } } if (additions != null) { foreach (var doc in additions) { Index.AddDocument(doc); } } }