lucene-java-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From o...@apache.org
Subject svn commit: r495190 - in /lucene/java/trunk: CHANGES.txt src/java/org/apache/lucene/index/IndexReader.java
Date Thu, 11 Jan 2007 10:53:26 GMT
Author: otis
Date: Thu Jan 11 02:53:25 2007
New Revision: 495190

URL: http://svn.apache.org/viewvc?view=rev&rev=495190
Log:
- Added isOptimized() to IndexReader

Modified:
    lucene/java/trunk/CHANGES.txt
    lucene/java/trunk/src/java/org/apache/lucene/index/IndexReader.java

Modified: lucene/java/trunk/CHANGES.txt
URL: http://svn.apache.org/viewvc/lucene/java/trunk/CHANGES.txt?view=diff&rev=495190&r1=495189&r2=495190
==============================================================================
--- lucene/java/trunk/CHANGES.txt (original)
+++ lucene/java/trunk/CHANGES.txt Thu Jan 11 02:53:25 2007
@@ -174,6 +174,9 @@
     setters for both the default Resolution, and per-field Resolution.
     For backwards compatibility, DateField is still used if no Resolutions
     are specified. (Michael Busch via Chris Hostetter)
+
+15. Added isOptimized() method to IndexReader.
+    (Otis Gospodnetic)
     
 Bug fixes
 

Modified: lucene/java/trunk/src/java/org/apache/lucene/index/IndexReader.java
URL: http://svn.apache.org/viewvc/lucene/java/trunk/src/java/org/apache/lucene/index/IndexReader.java?view=diff&rev=495190&r1=495189&r2=495190
==============================================================================
--- lucene/java/trunk/src/java/org/apache/lucene/index/IndexReader.java (original)
+++ lucene/java/trunk/src/java/org/apache/lucene/index/IndexReader.java Thu Jan 11 02:53:25
2007
@@ -278,6 +278,14 @@
   }
 
   /**
+   * Checks is the index is optimized (if it has a single segment and no deletions)
+   * @return <code>true</code> if the index is optimized; <code>false</code>
otherwise
+   */
+  public boolean isOptimized() {
+      return segmentInfos.size() == 1 && hasDeletions() == false;
+  }
+
+  /**
    *  Return an array of term frequency vectors for the specified document.
    *  The array contains a vector for each vectorized field in the document.
    *  Each vector contains terms and frequencies for all terms in a given vectorized field.



Mime
View raw message