示例#1
0
        private static void Run(string repositoryPath, string indexPath, string asmPath)
        {
            using (var x = SenseNet.ContentRepository.Repository.Start(
                       new SenseNet.ContentRepository.RepositoryStartSettings {
                Console = Console.Out, StartLuceneManager = false, StartWorkflowEngine = false, PluginsPath = asmPath
            }))
            {
                var y = (SenseNet.ContentRepository.RepositoryInstance)x;
                var z = y.StartupTrace;

                SenseNet.ContentRepository.Storage.Data.RepositoryConfiguration.WorkingModeIsPopulating = true;

                if (indexPath != null)
                {
                    StorageContext.Search.SetIndexDirectoryPath(indexPath);
                }

                _versionCount = SenseNet.ContentRepository.Storage.Data.DataProvider.GetVersionCount(repositoryPath);
                _factor       = Convert.ToDouble(_versionCount) / Convert.ToDouble(_progressHead.Length);
                //Console.WriteLine("Progress of populating {0} items:", _versionCount);
                //Console.WriteLine(_progressHead);
                Console.WriteLine("Populating {0} items:", _versionCount);
                Console.Write("Initializing ... ");

                var populator = new DocumentPopulator();
                populator.NodeIndexed += new EventHandler <NodeIndexedEvenArgs>(IndexBuilder_NodeIndexed);
                if (repositoryPath == null)
                {
                    populator.ClearAndPopulateAll();
                }
                else
                {
                    populator.RepopulateTree(repositoryPath);
                }
                populator.NodeIndexed -= new EventHandler <NodeIndexedEvenArgs>(IndexBuilder_NodeIndexed);

                Console.WriteLine();
                Console.WriteLine("Populating has been finished.");
            }
        }
示例#2
0
 private static IndexingActivityBase CreateTreeActivity(IndexingActivityType type, string path, int nodeId, IndexDocumentData indexDocumentData)
 {
     return(DocumentPopulator.CreateTreeActivity(type, path, nodeId, indexDocumentData));
 }
示例#3
0
 private static IndexingActivityBase CreateActivity(IndexingActivityType type, string path, int nodeId, int versionId, long versionTimestamp, IndexDocumentData indexDocumentData)
 {
     return(DocumentPopulator.CreateActivity(type, path, nodeId, versionId, versionTimestamp, null, indexDocumentData));
 }