// AddTreeActivity internal static bool AddTree(string treeRoot, int activityId, bool executingUnprocessedActivities) { var delTerms = executingUnprocessedActivities ? new [] { new SnTerm(IndexFieldName.InTree, treeRoot) } : null; var excludedNodeTypes = GetNotIndexedNodeTypes(); var docs = SearchManager.LoadIndexDocumentsByPath(treeRoot, excludedNodeTypes).Select(CreateIndexDocument); IndexingEngine.WriteIndex(delTerms, null, docs); return(true); }
// RemoveTreeActivity, RebuildActivity internal static bool DeleteDocuments(IEnumerable <SnTerm> deleteTerms, VersioningInfo versioning) { IndexingEngine.WriteIndex(deleteTerms, null, null); // don't need to check if indexing interfered here. If it did, change is detected in overlapped adddocument/updatedocument, and refresh (re-delete) is called there. // deletedocuments will never detect change in index, since it sets timestamp in indexhistory to maxvalue. return(true); }
/* AddDocumentActivity, RebuildActivity */ internal static bool AddDocument(IndexDocument document, VersioningInfo versioning) { var delTerms = versioning.Delete.Select(i => new SnTerm(IndexFieldName.VersionId, i)).ToArray(); var updates = GetUpdates(versioning); if (document != null) { SetDocumentFlags(document, versioning); } IndexingEngine.WriteIndex(delTerms, updates, new[] { document }); return(true); }
/* ClearAndPopulateAll */ internal static void AddDocuments(IEnumerable <IndexDocument> documents) { IndexingEngine.WriteIndex(null, null, documents); }