/// <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()); }
/// <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()); }
/// <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())); }
/// <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); }