Пример #1
0
        // 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);
        }
Пример #2
0
        // 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);
        }
Пример #3
0
        /* 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);
        }
Пример #4
0
 /* ClearAndPopulateAll */
 internal static void AddDocuments(IEnumerable <IndexDocument> documents)
 {
     IndexingEngine.WriteIndex(null, null, documents);
 }