Ejemplo n.º 1
0
 /// <summary>
 /// The number of documents deleted in the index
 /// </summary>
 /// <param name="indexer"></param>
 /// <returns></returns>
 public static int GetDeletedDocumentsCount(this LuceneIndexer indexer)
 {
     return(indexer.GetSearcherForIndexer().GetIndexReaderForSearcher().NumDeletedDocs());
 }
Ejemplo n.º 2
0
 /// <summary>
 /// Returns true if the index is optimized or not
 /// </summary>
 /// <param name="indexer"></param>
 /// <returns></returns>
 public static bool IsIndexOptimized(this LuceneIndexer indexer)
 {
     return(indexer.GetSearcherForIndexer().GetIndexReaderForSearcher().IsOptimized());
 }
Ejemplo n.º 3
0
 /// <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() ||
            IndexWriter.IsLocked(indexer.GetSearcherForIndexer().GetIndexReaderForSearcher().Directory()));
 }
Ejemplo n.º 4
0
 /// <summary>
 /// Return the total number of fields in the index
 /// </summary>
 /// <param name="indexer"></param>
 /// <returns></returns>
 public static int GetIndexFieldCount(this LuceneIndexer indexer)
 {
     return(indexer.GetSearcherForIndexer().GetIndexReaderForSearcher().GetFieldNames(IndexReader.FieldOption.ALL).Count);
 }