Пример #1
0
        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);
        }
Пример #2
0
        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);
                }
            }
        }