Lucene.Net.Store.Azure.AzureDirectory.Dispose C# (CSharp) Method

Dispose() protected method

Closes the store.
protected Dispose ( bool disposing ) : void
disposing bool
return void
        protected override void Dispose(bool disposing)
        {
            _blobContainer = null;
            _blobClient = null;
        }

Usage Example

Example #1
0
        private void GenerateLuceneIndex(List<Entry> entries)
        {
            Microsoft.WindowsAzure.Storage.CloudStorageAccount storageAccount = Microsoft.WindowsAzure.Storage.CloudStorageAccount.Parse("DefaultEndpointsProtocol=https;AccountName=diningsearchstorage;AccountKey=xeYMzXThFxrU7SsAMGbSWLdy9psLFRMk5NI8x0bx24xtEg9MPIstf/xwPdjvDm6HpHZaCPxxVFCv/7DDd5wymA==");
            AzureDirectory azureDirectory = new AzureDirectory(storageAccount, "diningsearchindex");
            Analyzer analyzer = new StandardAnalyzer(Lucene.Net.Util.Version.LUCENE_30);
            IndexWriter indexWriter = new IndexWriter(azureDirectory, analyzer, true, IndexWriter.MaxFieldLength.UNLIMITED);
            ////
            int c = 0;
            foreach (var entry in entries)
            {
                c++;
                var item = new Document();
                item.Add(new Field("Id", c.ToString(), Field.Store.YES, Field.Index.NOT_ANALYZED));
                item.Add(new Field("Dish", entry.DishName, Field.Store.YES, Field.Index.ANALYZED));
                item.Add(new Field("Cafe/Restaurant", string.Format("{0}/{1}", entry.CafeName, entry.RestaurantName), Field.Store.YES, Field.Index.ANALYZED));
                item.Add(new Field("URL", entry.CafeUrl, Field.Store.YES, Field.Index.NOT_ANALYZED));
                item.Add(new Field("Description", entry.Description ?? string.Empty, Field.Store.YES, Field.Index.ANALYZED));
                item.Add(new Field("Price", entry.Price, Field.Store.YES, Field.Index.NOT_ANALYZED));
                indexWriter.AddDocument(item);
            }

            ////

            indexWriter.Dispose();
            azureDirectory.Dispose();
        }
All Usage Examples Of Lucene.Net.Store.Azure.AzureDirectory::Dispose