예제 #1
0
        private static void IndexDocumentsMultiLevelDirectory(string directoryPath)
        {
            var documentIndexerFactory = new DocumentIndexerFactory();
            var fileHelper             = new FileHelper();
            var childDirectoryPaths    = fileHelper.GetChildDirectories(directoryPath);

            foreach (var childDirectoryPath in childDirectoryPaths)
            {
                var documentIndexer = documentIndexerFactory.GetDocumentIndexer(childDirectoryPath);
                IndexDocuments(childDirectoryPath, documentIndexer, fileHelper);
            }
        }
        private static void IndexDocuments(string directoryPath)
        {
            var documentIndexerFactory = new DocumentIndexerFactory();
            var documentIndexer        = documentIndexerFactory.GetDocumentIndexer(directoryPath);
            var documentIndexerHelper  = new FileHelper();

            var filePaths = documentIndexerHelper.GetFilePaths(directoryPath);

            foreach (var filePath in filePaths)
            {
                var documentToIndex = documentIndexer.GetDocumentToIndex(filePath);

                PrintDocumentInfo(documentToIndex);
                IndexDocument(documentToIndex);
            }
        }
        private static void IndexDocumentsMultiLevelDirectory(string directoryPath)
        {
            var documentIndexerFactory = new DocumentIndexerFactory();
            var fileHelper             = new FileHelper();
            var childDirectoryPaths    = fileHelper.GetChildDirectories(directoryPath);

            foreach (var childDirectoryPath in childDirectoryPaths)
            {
                //delete this
                var dirName = new DirectoryInfo(childDirectoryPath).Name;
                if (FoldersToSkip.Contains(dirName))
                {
                    continue;
                }


                var documentIndexer = documentIndexerFactory.GetDocumentIndexer(childDirectoryPath);
                IndexDocuments(childDirectoryPath, documentIndexer, fileHelper);
            }
        }