Index: build.xml
===================================================================
--- build.xml	(revision 1654482)
+++ build.xml	(working copy)
@@ -1,8 +1,9 @@
-<project name="Luke" default="dist">
+<project name="Luke" default="dist" xmlns:ivy="antlib:org.apache.ivy.ant">
   <defaultexcludes add="**/CVS" />
   <property name="build.dir" value="build" />
-  <property name="build.ver" value="4.3.1" />
+  <property name="build.ver" value="4.10.3" />
   <property name="dist.dir" value="dist" />
+  <property name="ivy.lib.dir" value="lib-ivy" />
   <property name="jarfile" value="${build.dir}/luke-${build.ver}.jar" />
   <property name="jarallfile" value="${build.dir}/lukeall-${build.ver}.jar" />
   <property name="jarminfile" value="${build.dir}/lukemin-${build.ver}.jar" />
@@ -19,10 +20,26 @@
     <delete dir="${dist.dir}" />
   </target>
 
+  <!-- resolve dependencies -->
+  <path id="ivy.lib.path">
+    <fileset dir="lib/tools" includes="*.jar"/>
+  </path>
+  <taskdef resource="org/apache/ivy/ant/antlib.xml"
+           uri="antlib:org.apache.ivy.ant" classpathref="ivy.lib.path"/>
+  <target name="ivy-resolve">
+    <ivy:retrieve conf="lucene" pattern="${ivy.lib.dir}/[artifact].[ext]"/>
+    <ivy:retrieve conf="pivot" pattern="${ivy.lib.dir}/[artifact].[ext]"/>
+    <ivy:retrieve conf="solr" pattern="${ivy.lib.dir}/[conf]/[artifact].[ext]"/>
+    <ivy:retrieve conf="hadoop" pattern="${ivy.lib.dir}/[conf]/[artifact].[ext]"/>
+  </target>
+  <target name="ivy-clean">
+    <delete dir="${ivy.lib.dir}"/>
+  </target>
+
   <target name="compile" depends="init">
     <javac classpath="${classpath}" sourcepath="" source="1.5" target="1.5" srcdir="src" destdir="${build.dir}">
       <classpath>
-        <fileset dir="lib">
+        <fileset dir="${ivy.lib.dir}">
           <include name="**/*.jar" />
         </fileset>
       </classpath>
@@ -33,7 +50,7 @@
   <target name="javadoc" depends="init">
     <javadoc sourcepath="src" packagenames="org.*" destdir="${build.dir}/api">
       <classpath>
-        <fileset dir="lib">
+        <fileset dir="${ivy.lib.dir}">
           <include name="**/*.jar" />
         </fileset>
       </classpath>
@@ -53,7 +70,7 @@
       </manifest>
     </jar>
     <unjar dest="${build.dir}">
-      <fileset dir="lib" includes="lucene-*.jar" />
+      <fileset dir="${ivy.lib.dir}" includes="lucene-*.jar" />
     </unjar>
     <jar basedir="${build.dir}" jarfile="${jarminfile}" includes=".plugins,img/,org/" excludes="org/mozilla/,org/apache/lucene/luke/plugins,**/*.js">
       <manifest>
@@ -62,20 +79,20 @@
       </manifest>
     </jar>
     <unjar dest="${build.dir}">
-      <fileset dir="lib" includes="pivot*.jar" />
+      <fileset dir="${ivy.lib.dir}" includes="pivot*.jar" />
     </unjar>
     <unjar dest="${build.dir}">
       <fileset dir="lib" includes="js.jar" />
-      <fileset dir="lib" includes="lucene*.jar" />
+      <fileset dir="${ivy.lib.dir}" includes="lucene*.jar" />
     </unjar>
     <unjar dest="${build.dir}">
-      <fileset dir="lib" includes="hadoop/*.jar" />
+      <fileset dir="${ivy.lib.dir}" includes="hadoop/*.jar" />
     </unjar>
     <unjar dest="${build.dir}">
-      <fileset dir="lib" includes="solr/*.jar" />
+      <fileset dir="${ivy.lib.dir}" includes="solr/*.jar" />
     </unjar>
     <unjar dest="${build.dir}">
-      <fileset dir="lib" includes="lucene-core-*.jar" />
+      <fileset dir="${ivy.lib.dir}" includes="lucene-core-*.jar" />
       <patternset>
         <include name="META-INF/MANIFEST.MF" />
       </patternset>
@@ -99,7 +116,8 @@
       </patternset>
     </fileset>
     <copy todir="${dist.dir}">
-      <fileset dir="lib" />
+      <fileset dir="lib" includes="js.jar"/>
+      <fileset dir="${ivy.lib.dir}" />
       <fileset file="${jarfile}" />
       <fileset file="${jarallfile}" />
       <fileset file="${jarminfile}" />
Index: ivy.xml
===================================================================
--- ivy.xml	(revision 0)
+++ ivy.xml	(working copy)
@@ -0,0 +1,57 @@
+<ivy-module version="2.0">
+  <info organisation="org.apache.lucene" module="luke"/>
+  <configurations>
+    <conf name="lucene" description="for Lucene jars"/>
+    <conf name="pivot" description="for Pivot jars"/>
+    <conf name="solr" description="for Solr jars"/>
+    <conf name="hadoop" description="for Hadoop jars"/>
+  </configurations>
+  <dependencies>
+    <!-- apache lucene -->
+    <dependency org="org.apache.lucene" name="lucene-analyzers-common" rev="4.10.3"
+                conf="lucene->*,!sources,!javadoc"/>
+    <dependency org="org.apache.lucene" name="lucene-codecs" rev="4.10.3"
+                conf="lucene->*,!sources,!javadoc"/>
+    <dependency org="org.apache.lucene" name="lucene-core" rev="4.10.3"
+                conf="lucene->*,!sources,!javadoc"/>
+    <dependency org="org.apache.lucene" name="lucene-misc" rev="4.10.3"
+                conf="lucene->*,!sources,!javadoc"/>
+    <dependency org="org.apache.lucene" name="lucene-queries" rev="4.10.3"
+                conf="lucene->*,!sources,!javadoc"/>
+    <dependency org="org.apache.lucene" name="lucene-queryparser" rev="4.10.3"
+                conf="lucene->*,!sources,!javadoc"/>
+
+    <!-- apache pivot -->
+    <dependency org="org.apache.pivot" name="pivot-charts" rev="2.0.4"
+                conf="pivot->*,!sources,!javadoc"/>
+    <dependency org="org.apache.pivot" name="pivot-core" rev="2.0.4"
+                conf="pivot->*,!sources,!javadoc"/>
+    <dependency org="org.apache.pivot" name="pivot-web" rev="2.0.4"
+                conf="pivot->*,!sources,!javadoc"/>
+    <dependency org="org.apache.pivot" name="pivot-web-server" rev="2.0.4"
+                conf="pivot->*,!sources,!javadoc"/>
+    <dependency org="org.apache.pivot" name="pivot-wtk" rev="2.0.4"
+                conf="pivot->*,!sources,!javadoc"/>
+    <dependency org="org.apache.pivot" name="pivot-wtk-terra" rev="2.0.4"
+                conf="pivot->*,!sources,!javadoc"/>
+
+    <!-- apache solr -->
+    <dependency org="org.apache.solr" name="solr-core" rev="4.10.3"
+                transitive="false"
+                conf="solr->*,!sources,!javadoc"/>
+    <dependency org="org.apache.solr" name="solr-solrj" rev="4.10.3"
+                transitive="false"
+                conf="solr->*,!sources,!javadoc"/>
+
+    <!-- apache hadoop -->
+    <dependency org="org.apache.hadoop" name="hadoop-core" rev="0.20.2"
+                conf="hadoop->*,!sources,!javadoc"/>
+      <dependency org="org.slf4j" name="slf4j-api" rev="1.4.3"
+                  conf="hadoop->*,!sources,!javadoc"/>
+      <dependency org="org.slf4j" name="slf4j-log4j12" rev="1.4.3"
+                  conf="hadoop->*,!sources,!javadoc"/>
+      <dependency org="net.sf.ehcache" name="ehcache" rev="1.6.0"
+                  conf="hadoop->*,!sources,!javadoc"/>
+
+  </dependencies>
+</ivy-module>
\ No newline at end of file
Index: lib/tools/ivy-2.3.0.jar
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/jar
Index: lib/tools/ivy-2.3.0.jar
===================================================================
--- lib/tools/ivy-2.3.0.jar	(revision 0)
+++ lib/tools/ivy-2.3.0.jar	(working copy)

Property changes on: lib/tools/ivy-2.3.0.jar
___________________________________________________________________
Added: svn:mime-type
## -0,0 +1 ##
+application/jar
\ No newline at end of property
Index: src/org/apache/lucene/index/IndexGate.java
===================================================================
--- src/org/apache/lucene/index/IndexGate.java	(revision 1654482)
+++ src/org/apache/lucene/index/IndexGate.java	(working copy)
@@ -17,20 +17,15 @@
  * limitations under the License.
  */
 
+import java.io.File;
 import java.io.IOException;
 import java.lang.reflect.Field;
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.Collections;
-import java.util.HashMap;
-import java.util.HashSet;
-import java.util.List;
-import java.util.Set;
+import java.util.*;
 
 import org.apache.lucene.codecs.Codec;
-import org.apache.lucene.store.Directory;
-import org.apache.lucene.store.IOContext;
-import org.apache.lucene.store.IndexInput;
+import org.apache.lucene.codecs.CodecUtil;
+import org.apache.lucene.store.*;
+import org.apache.lucene.util.IOUtils;
 
 /**
  * This class allows us to peek at various Lucene internals, not available
@@ -101,22 +96,59 @@
     }
     return res;
   }
-  
+
+  public static String getLastModified(final Directory dir) throws Exception {
+    SegmentInfos.FindSegmentsFile fsf = new SegmentInfos.FindSegmentsFile(dir) {
+      @Override
+      protected Object doBody(String segmentsFile) throws IOException {
+        if (dir instanceof FSDirectory) {
+          File file = new File(((FSDirectory)dir).getDirectory(), segmentsFile);
+          long lastModified = file.lastModified();
+          return lastModified;
+        }
+        return null;
+      }
+    };
+    Long lastModified = (Long)fsf.run();
+    return lastModified == null ? "N/A" : new Date(lastModified).toString();
+  }
+
   public static int getIndexFormat(final Directory dir) throws Exception {
     SegmentInfos.FindSegmentsFile fsf = new SegmentInfos.FindSegmentsFile(dir) {
-
+      @Override
       protected Object doBody(String segmentsFile) throws CorruptIndexException,
           IOException {
-        IndexInput in = dir.openInput(segmentsFile, IOContext.READONCE);
-        Integer indexFormat = new Integer(in.readInt());
-        in.close();
-        return indexFormat;
+        //IndexInput in = dir.openInput(segmentsFile, IOContext.READONCE);
+        //Integer indexFormat = new Integer(in.readInt());
+        //in.close();
+
+        // codes below were copied from SegmentInfos class in Lucene 4.10.3
+        boolean success = false;
+        ChecksumIndexInput input = directory.openChecksumInput(segmentsFile, IOContext.READ);
+        final int format = input.readInt();
+        final int actualFormat;
+        try {
+          if (format == CodecUtil.CODEC_MAGIC) {
+            actualFormat = CodecUtil.checkHeaderNoMagic(input, "segments", SegmentInfos.VERSION_40, SegmentInfos.VERSION_49);
+          } else {
+            actualFormat = -1;
+          }
+          success = true;
+        } finally {
+          if (!success) {
+            IOUtils.closeWhileHandlingException(input);
+          } else {
+            input.close();
+          }
+        }
+        return actualFormat;
       }
     };
     Integer indexFormat = (Integer)fsf.run();
     return indexFormat.intValue();
   }
-  
+
+
   public static int getCurrentIndexFormat() {
     return SegmentInfos.FORMAT_SEGMENTS_GEN_CURRENT;
   }
@@ -124,15 +156,37 @@
   public static FormatDetails getFormatDetails(int format) {
     FormatDetails res = new FormatDetails();
     switch (format) {
-    case -10:
-      res.capabilities = "flex";
-      res.genericName = "Lucene 4.x";
-      break;
-    default:
-      res.capabilities = "unknown";
-      res.genericName = "Lucene 3.x or prior";
-      break;
+      case SegmentInfos.VERSION_40:
+        res.capabilities = "flex";
+        res.genericName = "Lucene 4.0+";
+        break;
+      case SegmentInfos.VERSION_46:
+        res.capabilities = "flex";
+        res.genericName = "Lucene 4.6+";
+        break;
+      case SegmentInfos.VERSION_48:
+        res.capabilities = "flex";
+        res.genericName = "Lucene 4.8+";
+        break;
+      case SegmentInfos.VERSION_49:
+        res.capabilities = "flex";
+        res.genericName = "Lucene 4.9+";
+        break;
+      default:
+        res.capabilities = "unknown";
+        res.genericName = "Lucene 3.x or prior";
+        break;
     }
+//    switch (format) {
+//    case -10:
+//      res.capabilities = "flex";
+//      res.genericName = "Lucene 4.x";
+//      break;
+//    default:
+//      res.capabilities = "unknown";
+//      res.genericName = "Lucene 3.x or prior";
+//      break;
+//    }
     // TODO: this gate cannot reach into Lucene42FieldInfosFormat, it's in a codec sub package
 //    if (Lucene42FieldInfosFormat.FORMAT_CURRENT > format) {
 //      res.capabilities = null;
@@ -146,7 +200,8 @@
     infos.read(dir);
     int compound = 0, nonCompound = 0;
     for (int i = 0; i < infos.size(); i++) {
-      if (((SegmentInfoPerCommit)infos.info(i)).info.getUseCompoundFile()) {
+      //if (((SegmentInfoPerCommit)infos.info(i)).info.getUseCompoundFile()) {
+      if (infos.info(i).info.getUseCompoundFile()) {
         compound++;
       } else {
         nonCompound++;
@@ -193,8 +248,16 @@
   }
   
   public static class FormatDetails {
-    public String genericName = "N/A";
-    public String capabilities = "N/A";
+    protected String genericName = "N/A";
+    protected String capabilities = "N/A";
+
+    public String getGenericName() {
+      return genericName;
+    }
+
+    public String getCapabilities() {
+      return capabilities;
+    }
   }
 
 }
Index: src/org/apache/lucene/luke/core/IndexInfo.java
===================================================================
--- src/org/apache/lucene/luke/core/IndexInfo.java	(revision 1654482)
+++ src/org/apache/lucene/luke/core/IndexInfo.java	(working copy)
@@ -25,20 +25,12 @@
 import java.util.Map;
 
 import org.apache.lucene.codecs.Codec;
-import org.apache.lucene.index.AtomicReader;
-import org.apache.lucene.index.CompositeReader;
-import org.apache.lucene.index.DirectoryReader;
-import org.apache.lucene.index.FieldInfo;
-import org.apache.lucene.index.FieldInfos;
-import org.apache.lucene.index.Fields;
-import org.apache.lucene.index.IndexGate;
-import org.apache.lucene.index.IndexReader;
-import org.apache.lucene.index.MultiFields;
-import org.apache.lucene.index.SlowCompositeReaderWrapper;
-import org.apache.lucene.index.Terms;
-import org.apache.lucene.index.TermsEnum;
+import org.apache.lucene.document.Document;
+import org.apache.lucene.index.*;
+import org.apache.lucene.luke.core.decoders.*;
 import org.apache.lucene.search.IndexSearcher;
 import org.apache.lucene.store.Directory;
+import org.apache.lucene.util.Bits;
 
 public class IndexInfo {
   private IndexReader reader;
@@ -52,12 +44,14 @@
   private String version;
   private String dirImpl;
   private HashMap<String,FieldTermCount> termCounts = null;
+  private Map<String, Decoder> decoders;
   private Codec indexCodec;
   private boolean readOnly;
   private IndexSearcher indexSearcher;
   private int indexFormat;
+  private IndexGate.FormatDetails formatDetails;
   
-  public IndexInfo(IndexReader reader, String indexPath) throws Exception {
+  public IndexInfo(IndexReader reader, String indexPath, boolean readOnly) throws Exception {
     this.reader = reader;
     this.indexSearcher = new IndexSearcher(reader);
     this.dir = null;
@@ -74,7 +68,8 @@
     
     AtomicReader r;
     if (reader instanceof CompositeReader) {
-      r = new SlowCompositeReaderWrapper((CompositeReader)reader);
+      //r = new SlowCompositeReaderWrapper((CompositeReader)reader);
+      r = SlowCompositeReaderWrapper.wrap(reader);
     } else {
       r = (AtomicReader)reader;
     }
@@ -86,8 +81,13 @@
 
     Collections.sort(fieldNames);
     if (dir != null) {
+      indexCodec = IndexGate.getCodecOfFirstSegment(dir);
       indexFormat = IndexGate.getIndexFormat(dir);
+      formatDetails = IndexGate.getFormatDetails(indexFormat);
+      lastModified = IndexGate.getLastModified(dir);
     }
+
+    this.readOnly = readOnly;
   }
 
   private void countTerms() throws Exception {
@@ -118,6 +118,65 @@
       termCounts.put(fld, ftc);
     }
   }
+
+  private void guessDecoders() throws Exception {
+    decoders = new HashMap<String, Decoder>();
+
+    Fields fields = MultiFields.getFields(reader);
+    Bits liveDocs = MultiFields.getLiveDocs(reader);
+
+    // if there are no postings, throw an exception
+    if (fields == null) {
+      throw new Exception("There are no postings in the index reader.");
+    }
+
+    Iterator<String> fe = fields.iterator();
+    while (fe.hasNext()) {
+      String fld = fe.next();
+      Terms terms = fields.terms(fld);
+      TermsEnum te = null;
+      DocsEnum de = null;
+      if (terms != null) {
+        te = terms.iterator(te);
+        te.next();
+        de = MultiFields.getTermDocsEnum(reader, liveDocs, fld, te.term());
+        IndexableField field = null;
+        while (field == null && de.nextDoc() != DocsEnum.NO_MORE_DOCS) {
+          // look up first document which has this field value.
+          int docId = de.docID();
+          Document doc = reader.document(docId);
+          field = doc.getField(fld);
+        }
+        if (field == null) {
+          // there is no document having this field value.
+          continue;
+        }
+
+        // guess possible Decoder by field value of the first document
+        // TODO should be better way ...
+        if (field.numericValue() != null) {
+          // if non-null, this field has a numeric value
+          Number value = field.numericValue();
+          if (value instanceof Integer) {
+            decoders.put(fld, new NumIntDecoder());
+          } else if (value instanceof Long) {
+            // TODO could be DateDecoder
+            decoders.put(fld, new NumLongDecoder());
+          } else if (value instanceof Float) {
+            decoders.put(fld, new NumFloatDecoder());
+          } else if (value instanceof Double) {
+            decoders.put(fld, new NumDoubleDecoder());
+          }
+        } else if (field.binaryValue() != null) {
+          // if non-null, this field has a binary values
+          decoders.put(fld, new BinaryDecoder());
+        } else {
+          // this field may have a string value
+          decoders.put(fld, new StringDecoder());
+        }
+      }
+    }
+  }
   
   /**
    * @return the reader
@@ -126,12 +185,15 @@
     return reader;
   }
 
+  /**
+   * @return the directory
+   */
   public Directory getDirectory() {
     return dir;
   }
   
   /**
-   * @return the indexPath
+   * @return the index path
    */
   public String getIndexPath() {
     return indexPath;
@@ -138,7 +200,7 @@
   }
 
   /**
-   * @return the totalFileSize
+   * @return the total file size
    */
   public long getTotalFileSize() {
     return totalFileSize;
@@ -145,7 +207,7 @@
   }
 
   /**
-   * @return the numTerms
+   * @return the number of terms
    */
   public int getNumTerms() throws Exception {
     if (numTerms == -1) {
@@ -153,7 +215,11 @@
     }
     return numTerms;
   }
-  
+
+  /**
+   * @return the pairs of field name and the number of unique terms
+   * @throws Exception
+   */
   public Map<String,FieldTermCount> getFieldTermCounts() throws Exception {
     if (termCounts == null) {
       countTerms();
@@ -162,7 +228,7 @@
   }
 
   /**
-   * @return the topTerms
+   * @return the top frequent terms
    */
   public TermStats[] getTopTerms() throws Exception {
     if (topTerms == null) {
@@ -172,41 +238,87 @@
   }
 
   /**
-   * @return the fieldNames
+   * @return the pairs of the field name and Decoder
    */
+  public Map<String, Decoder> getDecoders() {
+    if (decoders == null) {
+      try {
+        guessDecoders();
+      } catch (Exception e) {
+        e.printStackTrace();
+      }
+    }
+    return decoders;
+  }
+
+  /**
+   * @return the field names
+   */
   public List<String> getFieldNames() {
     return fieldNames;
   }
 
   /**
-   * @return the lastModified
+   * @return the segment's last modified timestamp
    */
   public String getLastModified() {
     return lastModified;
   }
-  
+
+  /**
+   * @return the index version
+   */
   public String getVersion() {
     return version;
   }
-  
+
+  /**
+   * @return the directory implementation class's name
+   */
   public String getDirImpl() {
     return dirImpl;
   }
 
+  /**
+   * @return the index codec of first segment
+   */
   public Codec getIndexCodec() {
     return indexCodec;
   }
-  
+
+  /**
+   * @return the read only flag
+   */
   public boolean isReadOnly() {
     return readOnly;
   }
 
+  /**
+   * @return the index searcher
+   */
   public IndexSearcher getIndexSearcher() {
     return indexSearcher;
   }
-  
+
+  /**
+   * @return the Lucene index format version number
+   */
   public int getIndexFormat() {
     return indexFormat;
   }
 
+  /**
+   * @return the index format generic name
+   */
+  public String getIndexFormatText() {
+    return formatDetails.getGenericName();
+  }
+
+  /**
+   * @return the index format capability
+   */
+  public String getIndexCapabilities() {
+    return formatDetails.getCapabilities();
+  }
+
 }
Index: src/org/apache/lucene/luke/core/TableComparator.java
===================================================================
--- src/org/apache/lucene/luke/core/TableComparator.java	(revision 1654482)
+++ src/org/apache/lucene/luke/core/TableComparator.java	(working copy)
@@ -19,6 +19,7 @@
 
 import java.util.Comparator;
 
+import org.apache.pivot.collections.Dictionary;
 import org.apache.pivot.collections.Map;
 import org.apache.pivot.wtk.SortDirection;
 import org.apache.pivot.wtk.TableView;
@@ -36,12 +37,26 @@
   
   @Override
   public int compare(Map<String,String> o1, Map<String,String> o2) {
-    int result = o1.get("name").compareTo(o2.get("name"));
-    
-    SortDirection sortDirection = tableView.getSort().get("name");
-    
+    Dictionary.Pair<String, SortDirection> sort = tableView.getSort().get(0);
+
+    int result;
+    if (sort.key.equals("name")) {
+      // sort by name
+      result = o1.get(sort.key).compareTo(o2.get(sort.key));
+    } else if (sort.key.equals("termCount")) {
+      // sort by termCount
+      Integer c1 = Integer.parseInt(o1.get(sort.key));
+      Integer c2 = Integer.parseInt(o2.get(sort.key));
+      result = c1.compareTo(c2);
+    } else {
+      // other (ignored)
+      result = 0;
+    }
+    //int result = o1.get("name").compareTo(o2.get("name"));
+    //SortDirection sortDirection = tableView.getSort().get("name");
+    SortDirection sortDirection = sort.value;
     result *= (sortDirection == SortDirection.DESCENDING ? 1 : -1);
-    
+
     return result * -1;
   }
   
Index: src/org/apache/lucene/luke/core/decoders/NumDoubleDecoder.java
===================================================================
--- src/org/apache/lucene/luke/core/decoders/NumDoubleDecoder.java	(revision 0)
+++ src/org/apache/lucene/luke/core/decoders/NumDoubleDecoder.java	(working copy)
@@ -0,0 +1,24 @@
+package org.apache.lucene.luke.core.decoders;
+
+import org.apache.lucene.document.Field;
+import org.apache.lucene.util.BytesRef;
+import org.apache.lucene.util.NumericUtils;
+
+public class NumDoubleDecoder implements Decoder {
+
+  @Override
+  public String decodeTerm(String fieldName, Object value) {
+    BytesRef ref = new BytesRef(value.toString());
+    return Double.toString(NumericUtils.sortableLongToDouble(NumericUtils.prefixCodedToLong(ref)));
+  }
+
+  @Override
+  public String decodeStored(String fieldName, Field value) {
+    return value.stringValue();
+  }
+
+  public String toString() {
+    return "numeric-double";
+  }
+
+}
Index: src/org/apache/lucene/luke/core/decoders/NumFloatDecoder.java
===================================================================
--- src/org/apache/lucene/luke/core/decoders/NumFloatDecoder.java	(revision 0)
+++ src/org/apache/lucene/luke/core/decoders/NumFloatDecoder.java	(working copy)
@@ -0,0 +1,23 @@
+package org.apache.lucene.luke.core.decoders;
+
+import org.apache.lucene.document.Field;
+import org.apache.lucene.util.BytesRef;
+import org.apache.lucene.util.NumericUtils;
+
+public class NumFloatDecoder implements Decoder {
+  @Override
+  public String decodeTerm(String fieldName, Object value) {
+    BytesRef ref = new BytesRef(value.toString());
+    return Float.toString(NumericUtils.sortableIntToFloat(NumericUtils.prefixCodedToInt(ref)));
+  }
+
+  @Override
+  public String decodeStored(String fieldName, Field value) {
+    return value.stringValue();
+  }
+
+  public String toString() {
+    return "numeric-float";
+  }
+
+}
Index: src/org/apache/lucene/luke/ui/AnalyzersTab.java
===================================================================
--- src/org/apache/lucene/luke/ui/AnalyzersTab.java	(revision 1654482)
+++ src/org/apache/lucene/luke/ui/AnalyzersTab.java	(working copy)
@@ -68,7 +68,15 @@
         .getAnalyzerNames()));
     analyzersListButton.setSelectedIndex(0);
     List<String> versions = new ArrayList<String>();
-    Version[] values = Version.values();
+    // TODO: Version.values() was removed, and Version.LUCENE_X_X_X were all depricated. How do we fix this line?
+    //Version[] values = Version.values();
+    Version[] values = {
+      Version.LUCENE_3_0_0, Version.LUCENE_3_1_0, Version.LUCENE_3_2_0, Version.LUCENE_3_3_0,
+      Version.LUCENE_3_4_0, Version.LUCENE_3_5_0, Version.LUCENE_3_6_0,
+      Version.LUCENE_4_1_0, Version.LUCENE_4_2_0, Version.LUCENE_4_3_0, Version.LUCENE_4_4_0,
+      Version.LUCENE_4_5_0, Version.LUCENE_4_6_0, Version.LUCENE_4_7_0, Version.LUCENE_4_8_0,
+      Version.LUCENE_4_9_0, Version.LUCENE_4_10_0
+    };
     for (int i = 0; i < values.length; i++) {
       Version v = values[i];
       versions.add(v.toString());
@@ -116,8 +124,10 @@
   
   public void analyze() {
     try {
-      Version v = Version.valueOf((String) luceneVersionListButton
-          .getSelectedItem());
+      //Version v = Version.valueOf((String) luceneVersionListButton
+      // .getSelectedItem());
+      Version v = Version.parseLeniently((String) luceneVersionListButton
+        .getSelectedItem());
       Class clazz = Class.forName((String) analyzersListButton
           .getSelectedItem());
       Analyzer analyzer = null;
Index: src/org/apache/lucene/luke/ui/DocumentsTab.java
===================================================================
--- src/org/apache/lucene/luke/ui/DocumentsTab.java	(revision 1654482)
+++ src/org/apache/lucene/luke/ui/DocumentsTab.java	(working copy)
@@ -192,7 +192,8 @@
     this.idxInfo = lukeMediator.getIndexInfo();
     this.ir = idxInfo.getReader();
     if (ir instanceof CompositeReader) {
-      ar = new SlowCompositeReaderWrapper((CompositeReader) ir);
+      //ar = new SlowCompositeReaderWrapper((CompositeReader) ir);
+      ar = SlowCompositeReaderWrapper.wrap(ir);
     } else if (ir instanceof AtomicReader) {
       ar = (AtomicReader) ir;
     }
@@ -564,6 +565,7 @@
 
     fieldsList.setSelectedItem(t.field());
     Decoder dec = lukeMediator.getDecoders().get(t.field());
+
     if (dec == null)
       dec = lukeMediator.getDefDecoder();
     String s = null;
Index: src/org/apache/lucene/luke/ui/LukeApplication.java
===================================================================
--- src/org/apache/lucene/luke/ui/LukeApplication.java	(revision 1654482)
+++ src/org/apache/lucene/luke/ui/LukeApplication.java	(working copy)
@@ -20,6 +20,7 @@
 import java.awt.Font;
 import java.awt.GraphicsEnvironment;
 import java.util.Locale;
+import java.util.MissingResourceException;
 
 import org.apache.pivot.beans.BXMLSerializer;
 import org.apache.pivot.collections.Map;
@@ -34,6 +35,8 @@
 public class LukeApplication implements Application {
   public static final String LANGUAGE_KEY = "language";
 
+  private static final String DEFAULT_LANG = "en";
+
   LukeWindow lukeWindow = null;
 
   @Override
@@ -42,7 +45,17 @@
 
       String language = properties.get(LANGUAGE_KEY);
       Locale locale = (language == null) ? Locale.getDefault() : new Locale(language);
-      Resources resources = new Resources(getClass().getName(), locale);
+      Resources resources = null;
+      try {
+        resources = new Resources(getClass().getName(), locale);
+      } catch (MissingResourceException e) {
+        // if resource can't find, use default locale (en)
+        locale = new Locale(DEFAULT_LANG);
+        resources = new Resources(getClass().getName(), locale);
+        // if not reset default locale, same exception will occur
+        // when BXMLSerializer.readObject() is called with 3rd option localize=true...
+        Locale.setDefault(locale);
+      }
 
       Theme theme = Theme.getTheme();
       Font font = theme.getFont();
Index: src/org/apache/lucene/luke/ui/LukeApplication_en.json
===================================================================
--- src/org/apache/lucene/luke/ui/LukeApplication_en.json	(revision 1654482)
+++ src/org/apache/lucene/luke/ui/LukeApplication_en.json	(working copy)
@@ -42,7 +42,7 @@
  lukeInitWindow_termInfosDiv: "Custom TermInfos divisor:",
  
  overviewTab_indexPath: "Index path:",
- overviewTab_indexCodec: "Index Codec:",
+ overviewTab_indexCodec: "Index Codec (of the First Segment):",
  overviewTab_numFields: "Number of fields:",
  overviewTab_numDocs: "Number of documents:",
  overviewTab_numTerms: "Number of terms:",
Index: src/org/apache/lucene/luke/ui/LukeWindow.java
===================================================================
--- src/org/apache/lucene/luke/ui/LukeWindow.java	(revision 1654482)
+++ src/org/apache/lucene/luke/ui/LukeWindow.java	(working copy)
@@ -421,7 +421,7 @@
         indexReader = new MultiReader((IndexReader[]) readers.toArray(new IndexReader[readers.size()]));
       }
 
-      lukeMediator.indexInfo = new IndexInfo(indexReader, this.indexPath);
+      lukeMediator.indexInfo = new IndexInfo(indexReader, this.indexPath, readOnly);
 
       // TODO:
       // Collection<String> fieldNames =
@@ -673,7 +673,7 @@
   }
 
   private IndexReader indexReader;
-  private java.util.Map<String,Decoder> decoders = new HashMap<String,Decoder>();
+  //private java.util.Map<String,Decoder> decoders = new HashMap<String, Decoder>();
   private Decoder defDecoder = new StringDecoder();
   private String indexPath;
 
@@ -689,7 +689,7 @@
     }
 
     public java.util.Map<String,Decoder> getDecoders() {
-      return decoders;
+      return indexInfo.getDecoders();
     }
 
     public Decoder getDefDecoder() {
Index: src/org/apache/lucene/luke/ui/OverviewTab.bxml
===================================================================
--- src/org/apache/lucene/luke/ui/OverviewTab.bxml	(revision 1654482)
+++ src/org/apache/lucene/luke/ui/OverviewTab.bxml	(working copy)
@@ -176,7 +176,7 @@
 																	</TableView>
 																</view>
 																<columnHeader>
-																	<TableViewHeader tableView="$fieldsTable" />
+																	<TableViewHeader tableView="$fieldsTable" sortMode="single_column" />
 																</columnHeader>
 															</ScrollPane>
 														</content>
Index: src/org/apache/lucene/luke/ui/OverviewTab.java
===================================================================
--- src/org/apache/lucene/luke/ui/OverviewTab.java	(revision 1654482)
+++ src/org/apache/lucene/luke/ui/OverviewTab.java	(working copy)
@@ -24,7 +24,6 @@
 import org.apache.lucene.index.AtomicReaderContext;
 import org.apache.lucene.index.DirectoryReader;
 import org.apache.lucene.index.IndexCommit;
-import org.apache.lucene.index.IndexGate;
 import org.apache.lucene.index.IndexReader;
 import org.apache.lucene.index.SegmentReader;
 import org.apache.lucene.luke.core.FieldTermCount;
@@ -37,30 +36,15 @@
 import org.apache.lucene.store.Directory;
 import org.apache.pivot.beans.BXML;
 import org.apache.pivot.beans.Bindable;
-import org.apache.pivot.collections.ArrayList;
-import org.apache.pivot.collections.HashMap;
-import org.apache.pivot.collections.List;
-import org.apache.pivot.collections.Map;
-import org.apache.pivot.collections.Sequence;
+import org.apache.pivot.collections.*;
 import org.apache.pivot.serialization.SerializationException;
 import org.apache.pivot.util.Resources;
 import org.apache.pivot.util.concurrent.Task;
 import org.apache.pivot.util.concurrent.TaskExecutionException;
 import org.apache.pivot.util.concurrent.TaskListener;
-import org.apache.pivot.wtk.Action;
-import org.apache.pivot.wtk.ActivityIndicator;
-import org.apache.pivot.wtk.Alert;
-import org.apache.pivot.wtk.Component;
-import org.apache.pivot.wtk.Label;
-import org.apache.pivot.wtk.MessageType;
-import org.apache.pivot.wtk.SortDirection;
-import org.apache.pivot.wtk.Spinner;
-import org.apache.pivot.wtk.SplitPane;
-import org.apache.pivot.wtk.TablePane;
-import org.apache.pivot.wtk.TableView;
-import org.apache.pivot.wtk.TableViewSortListener;
-import org.apache.pivot.wtk.TaskAdapter;
+import org.apache.pivot.wtk.*;
 
+
 public class OverviewTab extends SplitPane implements Bindable {
 
   @BXML
@@ -127,12 +111,10 @@
   @Override
   public void initialize(Map<String,Object> namespace, URL location, Resources resources) {
     this.resources = resources;
-
   }
 
   public void initLukeMediator(LukeMediator lukeMediator) {
     this.lukeMediator = lukeMediator;
-
   }
 
   /**
@@ -162,7 +144,6 @@
       } else {
         idxName = indexPath;
       }
-
       iPath.setText(indexPath + (lukeMediator.getIndexInfo().isReadOnly() ? " (Read-Only)" : ""));
 
       // happens lower in the commented out code - future note
@@ -188,7 +169,7 @@
       // we need IndexReader from now on
 
       // TODO: Codecs are now per field...
-      // indexCodec.setText(lukeMediator.getIndexInfo().getIndexCodec().getName());
+      indexCodec.setText(lukeMediator.getIndexInfo().getIndexCodec().getName());
 
       // String modText = "N/A";
       // if (dir != null) {
@@ -196,6 +177,7 @@
       // .toString();
       // }
       // iMod.setText(modText);
+      iMod.setText(indexInfo.getLastModified());
 
       String numdocs = String.valueOf(ir.numDocs());
       iDocs.setText(numdocs);
@@ -282,7 +264,8 @@
 
       String sDel = ir.hasDeletions() ? "Yes (" + ir.numDeletedDocs() + ")" : "No";
       IndexCommit ic = ir instanceof DirectoryReader ? ((DirectoryReader) ir).getIndexCommit() : null;
-      String sDelOpt = ic != null ? (ic.getSegmentCount() == 1 ? "Yes" : "No") : "?";
+      String sOpt = ic != null ? (ic.getSegmentCount() == 1 ? "Yes" : "No") : "?";
+      String sDelOpt = sDel + " / " + sOpt;
       iDelOpt.setText(sDelOpt);
 
       String verText = "N/A";
@@ -294,10 +277,13 @@
       String formatText = "N/A";
       String formatCaps = "N/A";
       if (dir != null) {
-        int format = IndexGate.getIndexFormat(dir);
-        IndexGate.FormatDetails formatDetails = IndexGate.getFormatDetails(format);
-        formatText = format + " (" + formatDetails.genericName + ")";
-        formatCaps = formatDetails.capabilities;
+        //int format = IndexGate.getIndexFormat(dir);
+        //IndexGate.FormatDetails formatDetails = IndexGate.getFormatDetails(format);
+        //formatText = format + " (" + formatDetails.getGenericName() + ")";
+        //formatCaps = formatDetails.getCapabilities();
+        int format = indexInfo.getIndexFormat();
+        formatText = format + " (" + indexInfo.getIndexFormatText() + ")";
+        formatCaps = indexInfo.getIndexCapabilities();
         if (formatCaps == null) {
           formatCaps = (String) resources.get("overviewTab_newerVersionWarning");
         }
@@ -308,7 +294,8 @@
       String divText = "N/A";
 
       if (ir instanceof DirectoryReader) {
-        java.util.List<AtomicReaderContext> readers = ((DirectoryReader) ir).leaves();
+      //  java.util.List<AtomicReaderContext> readers = ((DirectoryReader) ir).leaves();
+        java.util.List<AtomicReaderContext> readers = ir.leaves();
         if (readers.size() > 0) {
           if (readers.get(0).reader() instanceof SegmentReader) {
             divText = String.valueOf(((SegmentReader) readers.get(0).reader()).getTermInfosIndexDivisor());
@@ -467,36 +454,15 @@
     NumberFormat percentFormat = NumberFormat.getNumberInstance();
     intCountFormat.setGroupingUsed(true);
     percentFormat.setMaximumFractionDigits(2);
-    // // sort by names now
-    final List<Map<String,String>> tableData = new ArrayList<Map<String,String>>();
-    tableData.setComparator(new TableComparator(fieldsTable));
-
-    fieldsTable.getTableViewSortListeners().add(new TableViewSortListener() {
-
+    fieldsTable.getTableViewSortListeners().add(new TableViewSortListener.Adapter() {
       @Override
-      public void sortAdded(TableView tableView, String columnName) {
-        tableView.setSort(columnName, SortDirection.ASCENDING);
-
-      }
-
-      @Override
-      public void sortUpdated(TableView tableView, String columnName, SortDirection previousSortDirection) {
-        tableView.setSort(columnName, previousSortDirection == SortDirection.ASCENDING ? SortDirection.DESCENDING : SortDirection.ASCENDING);
-
-      }
-
-      @Override
-      public void sortRemoved(TableView tableView, String columnName, SortDirection sortDirection) {
-        // TODO Auto-generated method stub
-      }
-
-      @Override
       public void sortChanged(TableView tableView) {
-        // tableData.setComparator(new TableComparator(tableView));
-
+        @SuppressWarnings("unchecked")
+        List<Map<String, String>> tableData = (List<Map<String, String>>) tableView.getTableData();
+        tableData.setComparator(new TableComparator(tableView));
       }
     });
-
+    // default sort : sorted by name in ascending order
     fieldsTable.setSort("name", SortDirection.ASCENDING);
 
     for (String s : indexInfo.getFieldNames()) {
@@ -519,6 +485,8 @@
         row.put("percent", "0.00%");
       }
 
+      //tableData.add(row);
+      List<Map<String, String>> tableData = (List<Map<String, String>>)fieldsTable.getTableData();
       tableData.add(row);
 
       Decoder dec = lukeMediator.getDecoders().get(s);
@@ -536,8 +504,7 @@
       // setString(choice, "text", s);
       // putProperty(choice, "fName", s);
     }
-    fieldsTable.setTableData(tableData);
-
+    //fieldsTable.setTableData(tableData);
   }
 
   private int getNTerms() {
