예제 #1
0
        public override Task <bool> Run()
        {
            FrameworksList frameworksList = new StorageFrameworksList(DataStorageAccount, DataContainerName, FrameworksList.FileName);

            Lucene.Net.Store.Directory directory = new SimpleFSDirectory(new DirectoryInfo(LocalIndexFolder));

            PackageIndexing.RebuildIndex(PackageDatabase.ConnectionString, directory, frameworksList, Console.Out);

            return(Task.FromResult(true));
        }
예제 #2
0
        static async Task BuildSearchIndexFromCatalog(string catalogPath, string resolverBlobPath, string dest, bool resetIndex)
        {
            Directory dir = new Lucene.Net.Store.SimpleFSDirectory(new System.IO.DirectoryInfo(dest));

            if (resetIndex)
            {
                PackageIndexing.CreateNewEmptyIndex(dir);
            }

            var catalog = new SearchIndexFromCatalogCollector(dir, "{0}/{1}.json");

            if (resolverBlobPath != null)
            {
                catalog.DependentCollections = new List <Uri> {
                    new Uri(resolverBlobPath)
                };
            }

            CollectorCursor cursor;

            //try
            //{
            //    IndexWriter writer = SearchIndexFromCatalogCollector.CreateIndexWriter(dir, false);
            //}
            //catch
            //{
            cursor = CollectorCursor.None;
            //}

            CollectorCursor finalCursor = await catalog.Run(
                new NuGet.Services.Metadata.Catalog.Collecting.CollectorHttpClient(),
                new Uri(catalogPath),
                cursor);

            return;
        }