Exemplo n.º 1
0
        public static IndexWriter GetAzureIndexWriter(this LuceneIndexer indexer)
        {
            indexer.EnsureIndex(false);
            var writer = new IndexWriter(indexer.GetLuceneDirectory(), indexer.IndexingAnalyzer, false, IndexWriter.MaxFieldLength.UNLIMITED);

            writer.SetRAMBufferSizeMB(10.0);
            writer.SetUseCompoundFile(false);
            writer.SetMaxMergeDocs(10000);
            writer.SetMergeFactor(100);
            return(writer);
        }
 /// <summary>
 /// Check if the index is locked
 /// </summary>
 /// <param name="indexer"></param>
 /// <returns></returns>
 /// <remarks>
 /// If the index does not exist we'll consider it locked
 /// </remarks>
 public static bool IsIndexLocked(this LuceneIndexer indexer)
 {
     return(indexer.IndexExists() == false ||
            IndexWriter.IsLocked(indexer.GetLuceneDirectory()));
 }