lucene-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mikemcc...@apache.org
Subject svn commit: r1635898 [5/6] - in /lucene/dev/branches/lucene6005/lucene: analysis/common/src/test/org/apache/lucene/collation/ analysis/icu/src/test/org/apache/lucene/collation/ analysis/uima/src/test/org/apache/lucene/analysis/uima/ backward-codecs/src...
Date Sat, 01 Nov 2014 08:39:30 GMT
Modified: lucene/dev/branches/lucene6005/lucene/core/src/test/org/apache/lucene/search/TestQueryRescorer.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene6005/lucene/core/src/test/org/apache/lucene/search/TestQueryRescorer.java?rev=1635898&r1=1635897&r2=1635898&view=diff
==============================================================================
--- lucene/dev/branches/lucene6005/lucene/core/src/test/org/apache/lucene/search/TestQueryRescorer.java (original)
+++ lucene/dev/branches/lucene6005/lucene/core/src/test/org/apache/lucene/search/TestQueryRescorer.java Sat Nov  1 08:39:27 2014
@@ -383,8 +383,8 @@ public class TestQueryRescorer extends L
                   @Override
                   public int compare(Integer a, Integer b) {
                     try {
-                      int av = idToNum[Integer.parseInt(r.document(a).get("id"))];
-                      int bv = idToNum[Integer.parseInt(r.document(b).get("id"))];
+                      int av = idToNum[Integer.parseInt(r.document(a).getString("id"))];
+                      int bv = idToNum[Integer.parseInt(r.document(b).getString("id"))];
                       if (av < bv) {
                         return -reverseInt;
                       } else if (bv < av) {
@@ -480,7 +480,7 @@ public class TestQueryRescorer extends L
 
             @Override
             public float score() throws IOException {
-              int num = idToNum[Integer.parseInt(context.reader().document(docID).get("id"))];
+              int num = idToNum[Integer.parseInt(context.reader().document(docID).getString("id"))];
               if (reverse) {
                 //System.out.println("score doc=" + docID + " num=" + num);
                 return num;

Modified: lucene/dev/branches/lucene6005/lucene/core/src/test/org/apache/lucene/search/TestSortRescorer.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene6005/lucene/core/src/test/org/apache/lucene/search/TestSortRescorer.java?rev=1635898&r1=1635897&r2=1635898&view=diff
==============================================================================
--- lucene/dev/branches/lucene6005/lucene/core/src/test/org/apache/lucene/search/TestSortRescorer.java (original)
+++ lucene/dev/branches/lucene6005/lucene/core/src/test/org/apache/lucene/search/TestSortRescorer.java Sat Nov  1 08:39:27 2014
@@ -152,8 +152,8 @@ public class TestSortRescorer extends Lu
                   @Override
                   public int compare(Integer a, Integer b) {
                     try {
-                      int av = idToNum[Integer.parseInt(r.document(a).get("id"))];
-                      int bv = idToNum[Integer.parseInt(r.document(b).get("id"))];
+                      int av = idToNum[Integer.parseInt(r.document(a).getString("id"))];
+                      int bv = idToNum[Integer.parseInt(r.document(b).getString("id"))];
                       if (av < bv) {
                         return -reverseInt;
                       } else if (bv < av) {

Modified: lucene/dev/branches/lucene6005/lucene/core/src/test/org/apache/lucene/search/spans/TestSpansAdvanced.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene6005/lucene/core/src/test/org/apache/lucene/search/spans/TestSpansAdvanced.java?rev=1635898&r1=1635897&r2=1635898&view=diff
==============================================================================
--- lucene/dev/branches/lucene6005/lucene/core/src/test/org/apache/lucene/search/spans/TestSpansAdvanced.java (original)
+++ lucene/dev/branches/lucene6005/lucene/core/src/test/org/apache/lucene/search/spans/TestSpansAdvanced.java Sat Nov  1 08:39:27 2014
@@ -19,20 +19,19 @@ package org.apache.lucene.search.spans;
 
 import java.io.IOException;
 
-import org.apache.lucene.document.Field;
-import org.apache.lucene.util.LuceneTestCase;
-
 import org.apache.lucene.analysis.MockAnalyzer;
 import org.apache.lucene.analysis.MockTokenFilter;
 import org.apache.lucene.analysis.MockTokenizer;
+import org.apache.lucene.document.Document2;
 import org.apache.lucene.document.Document;
+import org.apache.lucene.document.Field;
 import org.apache.lucene.index.IndexReader;
 import org.apache.lucene.index.RandomIndexWriter;
-import org.apache.lucene.index.StoredDocument;
 import org.apache.lucene.index.Term;
 import org.apache.lucene.search.*;
 import org.apache.lucene.search.similarities.DefaultSimilarity;
 import org.apache.lucene.store.Directory;
+import org.apache.lucene.util.LuceneTestCase;
 
 /*******************************************************************************
  * Tests the span query bug in Lucene. It demonstrates that SpanTermQuerys don't
@@ -153,8 +152,8 @@ public class TestSpansAdvanced extends L
       
       int id = topdocs.scoreDocs[i].doc;
       float score = topdocs.scoreDocs[i].score;
-      StoredDocument doc = s.doc(id);
-      assertEquals(expectedIds[i], doc.get(FIELD_ID));
+      Document2 doc = s.doc(id);
+      assertEquals(expectedIds[i], doc.getString(FIELD_ID));
       boolean scoreEq = Math.abs(expectedScores[i] - score) < tolerance;
       if (!scoreEq) {
         System.out.println(i + " warning, expected score: " + expectedScores[i]
@@ -166,4 +165,4 @@ public class TestSpansAdvanced extends L
     }
   }
   
-}
\ No newline at end of file
+}

Modified: lucene/dev/branches/lucene6005/lucene/core/src/test/org/apache/lucene/store/TestRAMDirectory.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene6005/lucene/core/src/test/org/apache/lucene/store/TestRAMDirectory.java?rev=1635898&r1=1635897&r2=1635898&view=diff
==============================================================================
--- lucene/dev/branches/lucene6005/lucene/core/src/test/org/apache/lucene/store/TestRAMDirectory.java (original)
+++ lucene/dev/branches/lucene6005/lucene/core/src/test/org/apache/lucene/store/TestRAMDirectory.java Sat Nov  1 08:39:27 2014
@@ -22,6 +22,7 @@ import java.nio.file.Files;
 import java.nio.file.Path;
 
 import org.apache.lucene.analysis.MockAnalyzer;
+import org.apache.lucene.document.Document2;
 import org.apache.lucene.document.Document;
 import org.apache.lucene.document.Field;
 import org.apache.lucene.index.DirectoryReader;
@@ -29,7 +30,6 @@ import org.apache.lucene.index.IndexRead
 import org.apache.lucene.index.IndexWriter;
 import org.apache.lucene.index.IndexWriterConfig.OpenMode;
 import org.apache.lucene.index.IndexWriterConfig;
-import org.apache.lucene.index.StoredDocument;
 import org.apache.lucene.search.IndexSearcher;
 import org.apache.lucene.util.English;
 import org.apache.lucene.util.IOUtils;
@@ -103,8 +103,8 @@ public class TestRAMDirectory extends Ba
     
     // search for all documents
     for (int i = 0; i < docsToAdd; i++) {
-      StoredDocument doc = searcher.doc(i);
-      assertTrue(doc.getField("content") != null);
+      Document2 doc = searcher.doc(i);
+      assertTrue(doc.get("content") != null);
     }
 
     // cleanup

Modified: lucene/dev/branches/lucene6005/lucene/demo/src/java/org/apache/lucene/demo/SearchFiles.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene6005/lucene/demo/src/java/org/apache/lucene/demo/SearchFiles.java?rev=1635898&r1=1635897&r2=1635898&view=diff
==============================================================================
--- lucene/dev/branches/lucene6005/lucene/demo/src/java/org/apache/lucene/demo/SearchFiles.java (original)
+++ lucene/dev/branches/lucene6005/lucene/demo/src/java/org/apache/lucene/demo/SearchFiles.java Sat Nov  1 08:39:27 2014
@@ -27,9 +27,9 @@ import java.util.Date;
 
 import org.apache.lucene.analysis.Analyzer;
 import org.apache.lucene.analysis.standard.StandardAnalyzer;
+import org.apache.lucene.document.Document2;
 import org.apache.lucene.index.DirectoryReader;
 import org.apache.lucene.index.IndexReader;
-import org.apache.lucene.index.StoredDocument;
 import org.apache.lucene.queryparser.classic.QueryParser;
 import org.apache.lucene.search.IndexSearcher;
 import org.apache.lucene.search.Query;
@@ -178,13 +178,13 @@ public class SearchFiles {
           continue;
         }
 
-        StoredDocument doc = searcher.doc(hits[i].doc);
-        String path = doc.get("path");
+        Document2 doc = searcher.doc(hits[i].doc);
+        String path = doc.getString("path");
         if (path != null) {
           System.out.println((i+1) + ". " + path);
-          String title = doc.get("title");
+          String title = doc.getString("title");
           if (title != null) {
-            System.out.println("   Title: " + doc.get("title"));
+            System.out.println("   Title: " + doc.getString("title"));
           }
         } else {
           System.out.println((i+1) + ". " + "No path for this document");

Modified: lucene/dev/branches/lucene6005/lucene/demo/src/java/org/apache/lucene/demo/xmlparser/FormBasedXmlQueryDemo.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene6005/lucene/demo/src/java/org/apache/lucene/demo/xmlparser/FormBasedXmlQueryDemo.java?rev=1635898&r1=1635897&r2=1635898&view=diff
==============================================================================
--- lucene/dev/branches/lucene6005/lucene/demo/src/java/org/apache/lucene/demo/xmlparser/FormBasedXmlQueryDemo.java (original)
+++ lucene/dev/branches/lucene6005/lucene/demo/src/java/org/apache/lucene/demo/xmlparser/FormBasedXmlQueryDemo.java Sat Nov  1 08:39:27 2014
@@ -25,7 +25,6 @@ import java.nio.charset.StandardCharsets
 import java.util.Enumeration;
 import java.util.Properties;
 import java.util.StringTokenizer;
-
 import javax.servlet.RequestDispatcher;
 import javax.servlet.ServletConfig;
 import javax.servlet.ServletException;
@@ -35,6 +34,7 @@ import javax.servlet.http.HttpServletRes
 
 import org.apache.lucene.analysis.Analyzer;
 import org.apache.lucene.analysis.standard.StandardAnalyzer;
+import org.apache.lucene.document.Document2;
 import org.apache.lucene.document.Document;
 import org.apache.lucene.document.Field;
 import org.apache.lucene.document.FieldType;
@@ -43,7 +43,6 @@ import org.apache.lucene.index.Directory
 import org.apache.lucene.index.IndexReader;
 import org.apache.lucene.index.IndexWriter;
 import org.apache.lucene.index.IndexWriterConfig;
-import org.apache.lucene.index.StoredDocument;
 import org.apache.lucene.queryparser.xml.CorePlusExtensionsParser;
 import org.apache.lucene.queryparser.xml.QueryTemplateManager;
 import org.apache.lucene.search.IndexSearcher;
@@ -116,7 +115,7 @@ public class FormBasedXmlQueryDemo exten
       //and package the results and forward to JSP
       if (topDocs != null) {
         ScoreDoc[] sd = topDocs.scoreDocs;
-        StoredDocument[] results = new StoredDocument[sd.length];
+        Document2[] results = new Document2[sd.length];
         for (int i = 0; i < results.length; i++) {
           results[i] = searcher.doc(sd[i].doc);
           request.setAttribute("results", results);

Modified: lucene/dev/branches/lucene6005/lucene/facet/src/java/org/apache/lucene/facet/FacetsConfig.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene6005/lucene/facet/src/java/org/apache/lucene/facet/FacetsConfig.java?rev=1635898&r1=1635897&r2=1635898&view=diff
==============================================================================
--- lucene/dev/branches/lucene6005/lucene/facet/src/java/org/apache/lucene/facet/FacetsConfig.java (original)
+++ lucene/dev/branches/lucene6005/lucene/facet/src/java/org/apache/lucene/facet/FacetsConfig.java Sat Nov  1 08:39:27 2014
@@ -40,6 +40,7 @@ import org.apache.lucene.facet.taxonomy.
 import org.apache.lucene.facet.taxonomy.IntAssociationFacetField;
 import org.apache.lucene.facet.taxonomy.TaxonomyWriter;
 import org.apache.lucene.index.IndexableField;
+import org.apache.lucene.index.IndexableFieldType;
 import org.apache.lucene.util.ArrayUtil;
 import org.apache.lucene.util.BytesRef;
 import org.apache.lucene.util.IntsRef;
@@ -209,7 +210,7 @@ public class FacetsConfig {
 
     Set<String> seenDims = new HashSet<>();
 
-    for (IndexableField field : doc.indexableFields()) {
+    for (IndexableField field : doc) {
       if (field.fieldType() == FacetField.TYPE) {
         FacetField facetField = (FacetField) field;
         FacetsConfig.DimConfig dimConfig = getDimConfig(facetField.dim);
@@ -289,8 +290,8 @@ public class FacetsConfig {
 
     //System.out.println("add stored: " + addedStoredFields);
 
-    for (Field field : doc.getFields()) {
-      FieldType ft = field.fieldType();
+    for (IndexableField field : doc.getFields()) {
+      IndexableFieldType ft = field.fieldType();
       if (ft != FacetField.TYPE && ft != SortedSetDocValuesFacetField.TYPE && ft != AssociationFacetField.TYPE) {
         result.add(field);
       }

Modified: lucene/dev/branches/lucene6005/lucene/facet/src/java/org/apache/lucene/facet/taxonomy/directory/DirectoryTaxonomyReader.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene6005/lucene/facet/src/java/org/apache/lucene/facet/taxonomy/directory/DirectoryTaxonomyReader.java?rev=1635898&r1=1635897&r2=1635898&view=diff
==============================================================================
--- lucene/dev/branches/lucene6005/lucene/facet/src/java/org/apache/lucene/facet/taxonomy/directory/DirectoryTaxonomyReader.java (original)
+++ lucene/dev/branches/lucene6005/lucene/facet/src/java/org/apache/lucene/facet/taxonomy/directory/DirectoryTaxonomyReader.java Sat Nov  1 08:39:27 2014
@@ -5,6 +5,7 @@ import java.util.Map;
 import java.util.logging.Level;
 import java.util.logging.Logger;
 
+import org.apache.lucene.document.Document2;
 import org.apache.lucene.facet.FacetsConfig;
 import org.apache.lucene.facet.taxonomy.FacetLabel;
 import org.apache.lucene.facet.taxonomy.LRUHashMap;
@@ -15,7 +16,6 @@ import org.apache.lucene.index.Directory
 import org.apache.lucene.index.DocsEnum;
 import org.apache.lucene.index.IndexWriter;
 import org.apache.lucene.index.MultiFields;
-import org.apache.lucene.index.StoredDocument;
 import org.apache.lucene.search.DocIdSetIterator;
 import org.apache.lucene.store.Directory;
 import org.apache.lucene.util.BytesRef;
@@ -312,8 +312,8 @@ public class DirectoryTaxonomyReader ext
       }
     }
     
-    StoredDocument doc = indexReader.document(ordinal);
-    FacetLabel ret = new FacetLabel(FacetsConfig.stringToPath(doc.get(Consts.FULL)));
+    Document2 doc = indexReader.document(ordinal);
+    FacetLabel ret = new FacetLabel(FacetsConfig.stringToPath(doc.getString(Consts.FULL)));
     synchronized (categoryCache) {
       categoryCache.put(catIDInteger, ret);
     }

Modified: lucene/dev/branches/lucene6005/lucene/facet/src/test/org/apache/lucene/facet/TestDrillSideways.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene6005/lucene/facet/src/test/org/apache/lucene/facet/TestDrillSideways.java?rev=1635898&r1=1635897&r2=1635898&view=diff
==============================================================================
--- lucene/dev/branches/lucene6005/lucene/facet/src/test/org/apache/lucene/facet/TestDrillSideways.java (original)
+++ lucene/dev/branches/lucene6005/lucene/facet/src/test/org/apache/lucene/facet/TestDrillSideways.java Sat Nov  1 08:39:27 2014
@@ -654,7 +654,7 @@ public class TestDrillSideways extends F
               final FixedBitSet bits = new FixedBitSet(maxDoc);
               for(int docID=0;docID < maxDoc;docID++) {
                 // Keeps only the even ids:
-                if ((acceptDocs == null || acceptDocs.get(docID)) && (Integer.parseInt(context.reader().document(docID).get("id")) & 1) == 0) {
+                if ((acceptDocs == null || acceptDocs.get(docID)) && (Integer.parseInt(context.reader().document(docID).getString("id")) & 1) == 0) {
                   bits.set(docID);
                 }
               }
@@ -740,7 +740,7 @@ public class TestDrillSideways extends F
       TopDocs hits = s.search(baseQuery, numDocs);
       Map<String,Float> scores = new HashMap<>();
       for(ScoreDoc sd : hits.scoreDocs) {
-        scores.put(s.doc(sd.doc).get("id"), sd.score);
+        scores.put(s.doc(sd.doc).getString("id"), sd.score);
       }
       if (VERBOSE) {
         System.out.println("  verify all facets");
@@ -917,7 +917,7 @@ public class TestDrillSideways extends F
 
     Map<String,Integer> idToDocID = new HashMap<>();
     for(int i=0;i<s.getIndexReader().maxDoc();i++) {
-      idToDocID.put(s.doc(i).get("id"), i);
+      idToDocID.put(s.doc(i).getString("id"), i);
     }
 
     Collections.sort(hits);

Modified: lucene/dev/branches/lucene6005/lucene/grouping/src/test/org/apache/lucene/search/grouping/DistinctValuesCollectorTest.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene6005/lucene/grouping/src/test/org/apache/lucene/search/grouping/DistinctValuesCollectorTest.java?rev=1635898&r1=1635897&r2=1635898&view=diff
==============================================================================
--- lucene/dev/branches/lucene6005/lucene/grouping/src/test/org/apache/lucene/search/grouping/DistinctValuesCollectorTest.java (original)
+++ lucene/dev/branches/lucene6005/lucene/grouping/src/test/org/apache/lucene/search/grouping/DistinctValuesCollectorTest.java Sat Nov  1 08:39:27 2014
@@ -32,6 +32,7 @@ import java.util.Random;
 import java.util.Set;
 
 import org.apache.lucene.analysis.MockAnalyzer;
+import org.apache.lucene.document.Document2;
 import org.apache.lucene.document.Document;
 import org.apache.lucene.document.Field;
 import org.apache.lucene.document.SortedDocValuesField;
@@ -39,7 +40,6 @@ import org.apache.lucene.document.String
 import org.apache.lucene.document.TextField;
 import org.apache.lucene.index.DirectoryReader;
 import org.apache.lucene.index.RandomIndexWriter;
-import org.apache.lucene.index.StoredDocument;
 import org.apache.lucene.index.Term;
 import org.apache.lucene.queries.function.valuesource.BytesRefFieldSource;
 import org.apache.lucene.search.IndexSearcher;
@@ -453,8 +453,8 @@ public class DistinctValuesCollectorTest
     DirectoryReader reader = w.getReader();
     if (VERBOSE) {
       for(int docID=0;docID<reader.maxDoc();docID++) {
-        StoredDocument doc = reader.document(docID);
-        System.out.println("docID=" + docID + " id=" + doc.get("id") + " content=" + doc.get("content") + " author=" + doc.get("author") + " publisher=" + doc.get("publisher"));
+        Document2 doc = reader.document(docID);
+        System.out.println("docID=" + docID + " id=" + doc.getString("id") + " content=" + doc.getString("content") + " author=" + doc.getString("author") + " publisher=" + doc.getString("publisher"));
       }
     }
 

Modified: lucene/dev/branches/lucene6005/lucene/highlighter/src/java/org/apache/lucene/search/highlight/TokenSources.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene6005/lucene/highlighter/src/java/org/apache/lucene/search/highlight/TokenSources.java?rev=1635898&r1=1635897&r2=1635898&view=diff
==============================================================================
--- lucene/dev/branches/lucene6005/lucene/highlighter/src/java/org/apache/lucene/search/highlight/TokenSources.java (original)
+++ lucene/dev/branches/lucene6005/lucene/highlighter/src/java/org/apache/lucene/search/highlight/TokenSources.java Sat Nov  1 08:39:27 2014
@@ -31,10 +31,10 @@ import org.apache.lucene.analysis.tokena
 import org.apache.lucene.analysis.tokenattributes.OffsetAttribute;
 import org.apache.lucene.analysis.tokenattributes.PayloadAttribute;
 import org.apache.lucene.analysis.tokenattributes.PositionIncrementAttribute;
+import org.apache.lucene.document.Document2;
 import org.apache.lucene.index.DocsAndPositionsEnum;
 import org.apache.lucene.index.Fields;
 import org.apache.lucene.index.IndexReader;
-import org.apache.lucene.index.StoredDocument;
 import org.apache.lucene.index.Terms;
 import org.apache.lucene.index.TermsEnum;
 import org.apache.lucene.util.ArrayUtil;
@@ -67,7 +67,7 @@ public class TokenSources {
    */
 
   public static TokenStream getAnyTokenStream(IndexReader reader, int docId,
-      String field, StoredDocument document, Analyzer analyzer) throws IOException {
+      String field, Document2 document, Analyzer analyzer) throws IOException {
     TokenStream ts = null;
 
     Fields vectors = reader.getTermVectors(docId);
@@ -315,13 +315,13 @@ public class TokenSources {
   // convenience method
   public static TokenStream getTokenStream(IndexReader reader, int docId,
       String field, Analyzer analyzer) throws IOException {
-    StoredDocument doc = reader.document(docId);
+    Document2 doc = reader.document(docId);
     return getTokenStream(doc, field, analyzer);
   }
   
-  public static TokenStream getTokenStream(StoredDocument doc, String field,
+  public static TokenStream getTokenStream(Document2 doc, String field,
       Analyzer analyzer) {
-    String contents = doc.get(field);
+    String contents = doc.getString(field);
     if (contents == null) {
       throw new IllegalArgumentException("Field " + field
           + " in document is not stored and cannot be analyzed");

Modified: lucene/dev/branches/lucene6005/lucene/highlighter/src/test/org/apache/lucene/search/highlight/HighlighterTest.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene6005/lucene/highlighter/src/test/org/apache/lucene/search/highlight/HighlighterTest.java?rev=1635898&r1=1635897&r2=1635898&view=diff
==============================================================================
--- lucene/dev/branches/lucene6005/lucene/highlighter/src/test/org/apache/lucene/search/highlight/HighlighterTest.java (original)
+++ lucene/dev/branches/lucene6005/lucene/highlighter/src/test/org/apache/lucene/search/highlight/HighlighterTest.java Sat Nov  1 08:39:27 2014
@@ -26,7 +26,6 @@ import java.util.Iterator;
 import java.util.List;
 import java.util.Map;
 import java.util.StringTokenizer;
-
 import javax.xml.parsers.DocumentBuilder;
 import javax.xml.parsers.DocumentBuilderFactory;
 
@@ -34,6 +33,7 @@ import org.apache.lucene.analysis.*;
 import org.apache.lucene.analysis.tokenattributes.CharTermAttribute;
 import org.apache.lucene.analysis.tokenattributes.OffsetAttribute;
 import org.apache.lucene.analysis.tokenattributes.PositionIncrementAttribute;
+import org.apache.lucene.document.Document2;
 import org.apache.lucene.document.Document;
 import org.apache.lucene.document.Field;
 import org.apache.lucene.document.IntField;
@@ -42,7 +42,6 @@ import org.apache.lucene.document.TextFi
 import org.apache.lucene.index.DirectoryReader;
 import org.apache.lucene.index.IndexReader;
 import org.apache.lucene.index.IndexWriter;
-import org.apache.lucene.index.StoredDocument;
 import org.apache.lucene.index.IndexWriterConfig.OpenMode;
 import org.apache.lucene.index.IndexWriterConfig;
 import org.apache.lucene.index.Term;
@@ -99,8 +98,8 @@ public class HighlighterTest extends Bas
 
 
     for (int i = 0; i < hits.scoreDocs.length; i++) {
-      StoredDocument doc = searcher.doc(hits.scoreDocs[i].doc);
-      String storedField = doc.get(FIELD_NAME);
+      Document2 doc = searcher.doc(hits.scoreDocs[i].doc);
+      String storedField = doc.getString(FIELD_NAME);
 
       TokenStream stream = TokenSources.getAnyTokenStream(searcher
           .getIndexReader(), hits.scoreDocs[i].doc, FIELD_NAME, doc, analyzer);
@@ -128,8 +127,8 @@ public class HighlighterTest extends Bas
     QueryScorer scorer = new QueryScorer(query, FIELD_NAME);
     Highlighter highlighter = new Highlighter(scorer);
 
-    StoredDocument doc = searcher.doc(hits.scoreDocs[0].doc);
-    String storedField = doc.get(FIELD_NAME);
+    Document2 doc = searcher.doc(hits.scoreDocs[0].doc);
+    String storedField = doc.getString(FIELD_NAME);
 
     TokenStream stream = TokenSources.getAnyTokenStream(searcher
         .getIndexReader(), hits.scoreDocs[0].doc, FIELD_NAME, doc, analyzer);
@@ -139,7 +138,7 @@ public class HighlighterTest extends Bas
     assertEquals("Hello <B>this</B> is a piece of text that is <B>very</B> <B>long</B> and contains too much preamble and the meat is really here which says kennedy has been shot", fragment);
     
     doc = searcher.doc(hits.scoreDocs[1].doc);
-    storedField = doc.get(FIELD_NAME);
+    storedField = doc.getString(FIELD_NAME);
 
     stream = TokenSources.getAnyTokenStream(searcher
         .getIndexReader(), hits.scoreDocs[1].doc, FIELD_NAME, doc, analyzer);
@@ -184,8 +183,8 @@ public class HighlighterTest extends Bas
     QueryScorer scorer = new QueryScorer(query, FIELD_NAME);
     Highlighter highlighter = new Highlighter(scorer);
 
-    StoredDocument doc = searcher.doc(hits.scoreDocs[0].doc);
-    String storedField = doc.get(FIELD_NAME);
+    Document2 doc = searcher.doc(hits.scoreDocs[0].doc);
+    String storedField = doc.getString(FIELD_NAME);
 
     TokenStream stream = TokenSources.getAnyTokenStream(searcher
         .getIndexReader(), hits.scoreDocs[0].doc, FIELD_NAME, doc, analyzer);
@@ -195,7 +194,7 @@ public class HighlighterTest extends Bas
     assertEquals("Hello <B>this</B> is a piece of text that is <B>very</B> <B>long</B> and contains too much preamble and the meat is really here which says kennedy has been shot", fragment);
     
     doc = searcher.doc(hits.scoreDocs[1].doc);
-    storedField = doc.get(FIELD_NAME);
+    storedField = doc.getString(FIELD_NAME);
 
     stream = TokenSources.getAnyTokenStream(searcher
         .getIndexReader(), hits.scoreDocs[1].doc, FIELD_NAME, doc, analyzer);
@@ -268,7 +267,7 @@ public class HighlighterTest extends Bas
     Highlighter highlighter = new Highlighter(scorer);
     
     for (int i = 0; i < hits.totalHits; i++) {
-      String text = searcher.doc(hits.scoreDocs[i].doc).get(FIELD_NAME);
+      String text = searcher.doc(hits.scoreDocs[i].doc).getString(FIELD_NAME);
       TokenStream tokenStream = analyzer.tokenStream(FIELD_NAME, text);
       highlighter.setTextFragmenter(new SimpleFragmenter(40));
 
@@ -346,7 +345,7 @@ public class HighlighterTest extends Bas
     Highlighter highlighter = new Highlighter(this, scorer);
     
     for (int i = 0; i < hits.totalHits; i++) {
-      String text = searcher.doc(hits.scoreDocs[i].doc).get(FIELD_NAME);
+      String text = searcher.doc(hits.scoreDocs[i].doc).getString(FIELD_NAME);
       TokenStream tokenStream = analyzer.tokenStream(FIELD_NAME, text);
 
       highlighter.setTextFragmenter(new SimpleFragmenter(40));
@@ -375,7 +374,7 @@ public class HighlighterTest extends Bas
     highlighter = new Highlighter(this, scorer);
     
     for (int i = 0; i < hits.totalHits; i++) {
-      String text = searcher.doc(hits.scoreDocs[i].doc).get(FIELD_NAME);
+      String text = searcher.doc(hits.scoreDocs[i].doc).getString(FIELD_NAME);
       TokenStream tokenStream = analyzer.tokenStream(FIELD_NAME, text);
 
       highlighter.setTextFragmenter(new SimpleFragmenter(40));
@@ -404,7 +403,7 @@ public class HighlighterTest extends Bas
     highlighter = new Highlighter(this, scorer);
     
     for (int i = 0; i < hits.totalHits; i++) {
-      String text = searcher.doc(hits.scoreDocs[i].doc).get(FIELD_NAME);
+      String text = searcher.doc(hits.scoreDocs[i].doc).getString(FIELD_NAME);
       TokenStream tokenStream = analyzer.tokenStream(FIELD_NAME, text);
 
       highlighter.setTextFragmenter(new SimpleFragmenter(40));
@@ -429,7 +428,7 @@ public class HighlighterTest extends Bas
     Highlighter highlighter = new Highlighter(this, scorer);
     
     for (int i = 0; i < hits.totalHits; i++) {
-      String text = searcher.doc(hits.scoreDocs[i].doc).get(FIELD_NAME);
+      String text = searcher.doc(hits.scoreDocs[i].doc).getString(FIELD_NAME);
       TokenStream tokenStream = analyzer.tokenStream(FIELD_NAME, text);
 
       highlighter.setTextFragmenter(new SimpleFragmenter(40));
@@ -453,7 +452,7 @@ public class HighlighterTest extends Bas
     Highlighter highlighter = new Highlighter(this, scorer);
     
     for (int i = 0; i < hits.totalHits; i++) {
-      String text = searcher.doc(hits.scoreDocs[i].doc).get(FIELD_NAME);
+      String text = searcher.doc(hits.scoreDocs[i].doc).getString(FIELD_NAME);
       TokenStream tokenStream = analyzer.tokenStream(FIELD_NAME, text);
 
       highlighter.setTextFragmenter(new SimpleFragmenter(40));
@@ -477,7 +476,7 @@ public class HighlighterTest extends Bas
     Highlighter highlighter = new Highlighter(this, scorer);
     
     for (int i = 0; i < hits.totalHits; i++) {
-      String text = searcher.doc(hits.scoreDocs[i].doc).get(FIELD_NAME);
+      String text = searcher.doc(hits.scoreDocs[i].doc).getString(FIELD_NAME);
       TokenStream tokenStream = analyzer.tokenStream(FIELD_NAME, text);
 
       highlighter.setTextFragmenter(new SimpleFragmenter(40));
@@ -531,7 +530,7 @@ public class HighlighterTest extends Bas
     highlighter.setTextFragmenter(new SimpleFragmenter(40));
     
     for (int i = 0; i < hits.totalHits; i++) {
-      String text = searcher.doc(hits.scoreDocs[i].doc).get(FIELD_NAME);
+      String text = searcher.doc(hits.scoreDocs[i].doc).getString(FIELD_NAME);
       TokenStream tokenStream = analyzer.tokenStream(FIELD_NAME, text);
 
       String result = highlighter.getBestFragments(tokenStream, text, maxNumFragmentsRequired,
@@ -553,7 +552,7 @@ public class HighlighterTest extends Bas
     int maxNumFragmentsRequired = 2;
 
     for (int i = 0; i < hits.totalHits; i++) {
-      String text = searcher.doc(hits.scoreDocs[i].doc).get(FIELD_NAME);
+      String text = searcher.doc(hits.scoreDocs[i].doc).getString(FIELD_NAME);
       TokenStream tokenStream = analyzer.tokenStream(FIELD_NAME, text);
       QueryScorer scorer = new QueryScorer(query, FIELD_NAME);
       Highlighter highlighter = new Highlighter(this, scorer);
@@ -583,7 +582,7 @@ public class HighlighterTest extends Bas
     Highlighter highlighter = new Highlighter(this, scorer);
   
     for (int i = 0; i < hits.totalHits; i++) {
-      String text = searcher.doc(hits.scoreDocs[i].doc).get(FIELD_NAME);
+      String text = searcher.doc(hits.scoreDocs[i].doc).getString(FIELD_NAME);
       TokenStream tokenStream = analyzer.tokenStream(FIELD_NAME, text);
 
       highlighter.setTextFragmenter(new SimpleSpanFragmenter(scorer, 5));
@@ -606,7 +605,7 @@ public class HighlighterTest extends Bas
     highlighter = new Highlighter(this, scorer);
 
     for (int i = 0; i < hits.totalHits; i++) {
-      String text = searcher.doc(hits.scoreDocs[i].doc).get(FIELD_NAME);
+      String text = searcher.doc(hits.scoreDocs[i].doc).getString(FIELD_NAME);
       TokenStream tokenStream = analyzer.tokenStream(FIELD_NAME, text);
 
       highlighter.setTextFragmenter(new SimpleSpanFragmenter(scorer, 20));
@@ -637,7 +636,7 @@ public class HighlighterTest extends Bas
     Highlighter highlighter = new Highlighter(this,scorer);
     
     for (int i = 0; i < hits.totalHits; i++) {
-      String text = searcher.doc(hits.scoreDocs[i].doc).get(FIELD_NAME);
+      String text = searcher.doc(hits.scoreDocs[i].doc).getString(FIELD_NAME);
       TokenStream tokenStream = analyzer.tokenStream(FIELD_NAME, text);
 
       highlighter.setTextFragmenter(new SimpleFragmenter(40));
@@ -708,7 +707,7 @@ public class HighlighterTest extends Bas
     highlighter.setTextFragmenter(new SimpleFragmenter(40));
     int maxNumFragmentsRequired = 2;
     for (int i = 0; i < hits.totalHits; i++) {
-      String text = searcher.doc(hits.scoreDocs[i].doc).get(FIELD_NAME);
+      String text = searcher.doc(hits.scoreDocs[i].doc).getString(FIELD_NAME);
       TokenStream tokenStream = analyzer.tokenStream(FIELD_NAME, text);
 
       String result = highlighter.getBestFragments(tokenStream, text, maxNumFragmentsRequired,
@@ -902,7 +901,7 @@ public class HighlighterTest extends Bas
     hits = searcher.search(query, null, 1000);
 
     for (int i = 0; i < hits.totalHits; i++) {
-      String text = searcher.doc(hits.scoreDocs[i].doc).get(HighlighterTest.FIELD_NAME);
+      String text = searcher.doc(hits.scoreDocs[i].doc).getString(HighlighterTest.FIELD_NAME);
       int maxNumFragmentsRequired = 2;
       String fragmentSeparator = "...";
       QueryScorer scorer = new QueryScorer(query, HighlighterTest.FIELD_NAME);
@@ -926,7 +925,7 @@ public class HighlighterTest extends Bas
     numHighlights = 0;
 
     for (int i = 0; i < hits.totalHits; i++) {
-      String text = searcher.doc(hits.scoreDocs[i].doc).get(HighlighterTest.FIELD_NAME);
+      String text = searcher.doc(hits.scoreDocs[i].doc).getString(HighlighterTest.FIELD_NAME);
       int maxNumFragmentsRequired = 2;
       String fragmentSeparator = "...";
       QueryScorer scorer = new QueryScorer(query, null);
@@ -950,7 +949,7 @@ public class HighlighterTest extends Bas
     numHighlights = 0;
 
     for (int i = 0; i < hits.totalHits; i++) {
-      String text = searcher.doc(hits.scoreDocs[i].doc).get(HighlighterTest.FIELD_NAME);
+      String text = searcher.doc(hits.scoreDocs[i].doc).getString(HighlighterTest.FIELD_NAME);
       int maxNumFragmentsRequired = 2;
       String fragmentSeparator = "...";
       QueryScorer scorer = new QueryScorer(query, "random_field", HighlighterTest.FIELD_NAME);
@@ -1124,7 +1123,7 @@ public class HighlighterTest extends Bas
         doSearching(new TermQuery(new Term(FIELD_NAME, "kennedy")));
         numHighlights = 0;
         for (int i = 0; i < hits.totalHits; i++) {
-          String text = searcher.doc(hits.scoreDocs[i].doc).get(FIELD_NAME);
+          String text = searcher.doc(hits.scoreDocs[i].doc).getString(FIELD_NAME);
           TokenStream tokenStream = analyzer.tokenStream(FIELD_NAME, text);
 
           Highlighter highlighter = getHighlighter(query, FIELD_NAME,
@@ -1138,7 +1137,7 @@ public class HighlighterTest extends Bas
 
         numHighlights = 0;
         for (int i = 0; i < hits.totalHits; i++) {
-          String text = searcher.doc(hits.scoreDocs[i].doc).get(FIELD_NAME);
+          String text = searcher.doc(hits.scoreDocs[i].doc).getString(FIELD_NAME);
           Highlighter highlighter = getHighlighter(query, FIELD_NAME,
               HighlighterTest.this);
           highlighter.getBestFragment(analyzer, FIELD_NAME, text);
@@ -1148,7 +1147,7 @@ public class HighlighterTest extends Bas
 
         numHighlights = 0;
         for (int i = 0; i < hits.totalHits; i++) {
-          String text = searcher.doc(hits.scoreDocs[i].doc).get(FIELD_NAME);
+          String text = searcher.doc(hits.scoreDocs[i].doc).getString(FIELD_NAME);
 
           Highlighter highlighter = getHighlighter(query, FIELD_NAME,
               HighlighterTest.this);
@@ -1255,7 +1254,7 @@ public class HighlighterTest extends Bas
         // new Highlighter(HighlighterTest.this, new QueryTermScorer(query));
 
         for (int i = 0; i < hits.totalHits; i++) {
-          String text = searcher.doc(hits.scoreDocs[i].doc).get(FIELD_NAME);
+          String text = searcher.doc(hits.scoreDocs[i].doc).getString(FIELD_NAME);
           TokenStream tokenStream = analyzer.tokenStream(FIELD_NAME, text);
           Highlighter highlighter = getHighlighter(query, FIELD_NAME,
               HighlighterTest.this);
@@ -1278,7 +1277,7 @@ public class HighlighterTest extends Bas
         doSearching(new TermQuery(new Term(FIELD_NAME, "kennedy")));
 
         for (int i = 0; i < hits.totalHits; i++) {
-          String text = searcher.doc(hits.scoreDocs[i].doc).get(FIELD_NAME);
+          String text = searcher.doc(hits.scoreDocs[i].doc).getString(FIELD_NAME);
           TokenStream tokenStream = analyzer.tokenStream(FIELD_NAME, text);
 
           Highlighter highlighter = getHighlighter(query, FIELD_NAME,
@@ -1430,7 +1429,7 @@ public class HighlighterTest extends Bas
         int maxNumFragmentsRequired = 3;
 
         for (int i = 0; i < hits.totalHits; i++) {
-          String text = searcher.doc(hits.scoreDocs[i].doc).get(FIELD_NAME);
+          String text = searcher.doc(hits.scoreDocs[i].doc).getString(FIELD_NAME);
           TokenStream tokenStream = analyzer.tokenStream(FIELD_NAME, text);
           Highlighter highlighter = getHighlighter(query, FIELD_NAME, HighlighterTest.this, false);
 
@@ -1798,8 +1797,8 @@ public class HighlighterTest extends Bas
 
     TopDocs hits = searcher.search(query, null, 10);
     for( int i = 0; i < hits.totalHits; i++ ){
-      StoredDocument doc = searcher.doc( hits.scoreDocs[i].doc );
-      String result = h.getBestFragment( a, "t_text1", doc.get( "t_text1" ));
+      Document2 doc = searcher.doc(hits.scoreDocs[i].doc);
+      String result = h.getBestFragment( a, "t_text1", doc.getString("t_text1"));
       if (VERBOSE) System.out.println("result:" +  result);
       assertEquals("more <B>random</B> words for second field", result);
     }
@@ -1853,7 +1852,7 @@ public class HighlighterTest extends Bas
   public void assertExpectedHighlightCount(final int maxNumFragmentsRequired,
       final int expectedHighlights) throws Exception {
     for (int i = 0; i < hits.totalHits; i++) {
-      String text = searcher.doc(hits.scoreDocs[i].doc).get(FIELD_NAME);
+      String text = searcher.doc(hits.scoreDocs[i].doc).getString(FIELD_NAME);
       TokenStream tokenStream = analyzer.tokenStream(FIELD_NAME, text);
       QueryScorer scorer = new QueryScorer(query, FIELD_NAME);
       Highlighter highlighter = new Highlighter(this, scorer);
@@ -2099,7 +2098,7 @@ final class SynonymTokenizer extends Tok
         throws Exception {
 
       for (int i = 0; i < hits.totalHits; i++) {
-        String text = searcher.doc(hits.scoreDocs[i].doc).get(HighlighterTest.FIELD_NAME);
+        String text = searcher.doc(hits.scoreDocs[i].doc).getString(HighlighterTest.FIELD_NAME);
         int maxNumFragmentsRequired = 2;
         String fragmentSeparator = "...";
         Scorer scorer = null;

Modified: lucene/dev/branches/lucene6005/lucene/highlighter/src/test/org/apache/lucene/search/postingshighlight/TestPostingsHighlighter.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene6005/lucene/highlighter/src/test/org/apache/lucene/search/postingshighlight/TestPostingsHighlighter.java?rev=1635898&r1=1635897&r2=1635898&view=diff
==============================================================================
--- lucene/dev/branches/lucene6005/lucene/highlighter/src/test/org/apache/lucene/search/postingshighlight/TestPostingsHighlighter.java (original)
+++ lucene/dev/branches/lucene6005/lucene/highlighter/src/test/org/apache/lucene/search/postingshighlight/TestPostingsHighlighter.java Sat Nov  1 08:39:27 2014
@@ -28,6 +28,7 @@ import java.util.Map;
 import org.apache.lucene.analysis.Analyzer;
 import org.apache.lucene.analysis.MockAnalyzer;
 import org.apache.lucene.analysis.MockTokenizer;
+import org.apache.lucene.document.Document2;
 import org.apache.lucene.document.Document;
 import org.apache.lucene.document.Field;
 import org.apache.lucene.document.FieldType;
@@ -37,7 +38,6 @@ import org.apache.lucene.index.FieldInfo
 import org.apache.lucene.index.IndexReader;
 import org.apache.lucene.index.IndexWriterConfig;
 import org.apache.lucene.index.RandomIndexWriter;
-import org.apache.lucene.index.StoredDocument;
 import org.apache.lucene.index.Term;
 import org.apache.lucene.search.BooleanClause;
 import org.apache.lucene.search.BooleanQuery;
@@ -941,8 +941,8 @@ public class TestPostingsHighlighter ext
     String snippets[] = highlighter.highlight("body", query, searcher, hits);
     assertEquals(numDocs, snippets.length);
     for(int hit=0;hit<numDocs;hit++) {
-      StoredDocument doc = searcher.doc(hits.scoreDocs[hit].doc);
-      int id = Integer.parseInt(doc.get("id"));
+      Document2 doc = searcher.doc(hits.scoreDocs[hit].doc);
+      int id = Integer.parseInt(doc.getString("id"));
       String expected = "the <b>answer</b> is " + id;
       if ((id  & 1) == 0) {
         expected += " some more terms";

Modified: lucene/dev/branches/lucene6005/lucene/join/src/test/org/apache/lucene/search/join/TestBlockJoin.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene6005/lucene/join/src/test/org/apache/lucene/search/join/TestBlockJoin.java?rev=1635898&r1=1635897&r2=1635898&view=diff
==============================================================================
--- lucene/dev/branches/lucene6005/lucene/join/src/test/org/apache/lucene/search/join/TestBlockJoin.java (original)
+++ lucene/dev/branches/lucene6005/lucene/join/src/test/org/apache/lucene/search/join/TestBlockJoin.java Sat Nov  1 08:39:27 2014
@@ -111,11 +111,11 @@ public class TestBlockJoin extends Lucen
     assertEquals(1, results.totalGroupedHitCount);
     assertEquals(1, results.groups.length);
     final GroupDocs<Integer> group = results.groups[0];
-    StoredDocument childDoc = s.doc(group.scoreDocs[0].doc);
-    assertEquals("java", childDoc.get("skill"));
+    Document2 childDoc = s.doc(group.scoreDocs[0].doc);
+    assertEquals("java", childDoc.getString("skill"));
     assertNotNull(group.groupValue);
-    StoredDocument parentDoc = s.doc(group.groupValue);
-    assertEquals("Lisa", parentDoc.get("name"));
+    Document2 parentDoc = s.doc(group.groupValue);
+    assertEquals("Lisa", parentDoc.getString("name"));
 
     r.close();
     dir.close();
@@ -179,11 +179,11 @@ public class TestBlockJoin extends Lucen
     assertEquals(1, group.totalHits);
     assertFalse(Float.isNaN(group.score));
 
-    StoredDocument childDoc = s.doc(group.scoreDocs[0].doc);
+    Document2 childDoc = s.doc(group.scoreDocs[0].doc);
     //System.out.println("  doc=" + group.scoreDocs[0].doc);
-    assertEquals("java", childDoc.get("skill"));
+    assertEquals("java", childDoc.getString("skill"));
     assertNotNull(group.groupValue);
-    StoredDocument parentDoc = s.doc(group.groupValue);
+    Document2 parentDoc = s.doc(group.groupValue);
     assertEquals("Lisa", parentDoc.get("name"));
 
 
@@ -355,7 +355,7 @@ public class TestBlockJoin extends Lucen
     }
   }
   
-  private StoredDocument getParentDoc(IndexReader reader, Filter parents, int childDocID) throws IOException {
+  private Document2 getParentDoc(IndexReader reader, Filter parents, int childDocID) throws IOException {
     final List<LeafReaderContext> leaves = reader.leaves();
     final int subIndex = ReaderUtil.subIndex(childDocID, leaves);
     final LeafReaderContext leaf = leaves.get(subIndex);
@@ -752,7 +752,7 @@ public class TestBlockJoin extends Lucen
         System.out.println("\nTEST: normal index gets " + results.totalHits + " hits; sort=" + parentAndChildSort);
         final ScoreDoc[] hits = results.scoreDocs;
         for(int hitIDX=0;hitIDX<hits.length;hitIDX++) {
-          final StoredDocument doc = s.doc(hits[hitIDX].doc);
+          final Document2 doc = s.doc(hits[hitIDX].doc);
           //System.out.println("  score=" + hits[hitIDX].score + " parentID=" + doc.get("parentID") + " childID=" + doc.get("childID") + " (docID=" + hits[hitIDX].doc + ")");
           System.out.println("  parentID=" + doc.get("parentID") + " childID=" + doc.get("childID") + " (docID=" + hits[hitIDX].doc + ")");
           FieldDoc fd = (FieldDoc) hits[hitIDX];
@@ -806,12 +806,12 @@ public class TestBlockJoin extends Lucen
             }
 
             assertNotNull(group.groupValue);
-            final StoredDocument parentDoc = joinS.doc(group.groupValue);
+            final Document2 parentDoc = joinS.doc(group.groupValue);
             System.out.println("  group parentID=" + parentDoc.get("parentID") + " (docID=" + group.groupValue + ")");
             for(int hitIDX=0;hitIDX<group.scoreDocs.length;hitIDX++) {
-              final StoredDocument doc = joinS.doc(group.scoreDocs[hitIDX].doc);
+              final Document2 doc = joinS.doc(group.scoreDocs[hitIDX].doc);
               //System.out.println("    score=" + group.scoreDocs[hitIDX].score + " childID=" + doc.get("childID") + " (docID=" + group.scoreDocs[hitIDX].doc + ")");
-              System.out.println("    childID=" + doc.get("childID") + " child0=" + doc.get("child0") + " (docID=" + group.scoreDocs[hitIDX].doc + ")");
+              System.out.println("    childID=" + doc.getString("childID") + " child0=" + doc.getString("child0") + " (docID=" + group.scoreDocs[hitIDX].doc + ")");
             }
           }
         }
@@ -824,8 +824,8 @@ public class TestBlockJoin extends Lucen
         TopDocs b = joinS.search(childJoinQuery, 10);
         for (ScoreDoc hit : b.scoreDocs) {
           Explanation explanation = joinS.explain(childJoinQuery, hit.doc);
-          StoredDocument document = joinS.doc(hit.doc - 1);
-          int childId = Integer.parseInt(document.get("childID"));
+          Document2 document = joinS.doc(hit.doc - 1);
+          int childId = Integer.parseInt(document.getString("childID"));
           //System.out.println("  hit docID=" + hit.doc + " childId=" + childId + " parentId=" + document.get("parentID"));
           assertTrue(explanation.isMatch());
           assertEquals(hit.score, explanation.getValue(), 0.0f);
@@ -953,8 +953,8 @@ public class TestBlockJoin extends Lucen
       if (VERBOSE) {
         System.out.println("  " + results2.totalHits + " totalHits:");
         for(ScoreDoc sd : results2.scoreDocs) {
-          final StoredDocument doc = s.doc(sd.doc);
-          System.out.println("  childID=" + doc.get("childID") + " parentID=" + doc.get("parentID") + " docID=" + sd.doc);
+          final Document2 doc = s.doc(sd.doc);
+          System.out.println("  childID=" + doc.getString("childID") + " parentID=" + doc.get("parentID") + " docID=" + sd.doc);
         }
       }
 
@@ -967,9 +967,9 @@ public class TestBlockJoin extends Lucen
       if (VERBOSE) {
         System.out.println("  " + joinResults2.totalHits + " totalHits:");
         for(ScoreDoc sd : joinResults2.scoreDocs) {
-          final StoredDocument doc = joinS.doc(sd.doc);
-          final StoredDocument parentDoc = getParentDoc(joinR, parentsFilter, sd.doc);
-          System.out.println("  childID=" + doc.get("childID") + " parentID=" + parentDoc.get("parentID") + " docID=" + sd.doc);
+          final Document2 doc = joinS.doc(sd.doc);
+          final Document2 parentDoc = getParentDoc(joinR, parentsFilter, sd.doc);
+          System.out.println("  childID=" + doc.getString("childID") + " parentID=" + parentDoc.getString("parentID") + " docID=" + sd.doc);
         }
       }
 
@@ -988,10 +988,10 @@ public class TestBlockJoin extends Lucen
     for(int hitCount=0;hitCount<results.scoreDocs.length;hitCount++) {
       ScoreDoc hit = results.scoreDocs[hitCount];
       ScoreDoc joinHit = joinResults.scoreDocs[hitCount];
-      StoredDocument doc1 = r.document(hit.doc);
-      StoredDocument doc2 = joinR.document(joinHit.doc);
+      Document2 doc1 = r.document(hit.doc);
+      Document2 doc2 = joinR.document(joinHit.doc);
       assertEquals("hit " + hitCount + " differs",
-                   doc1.get("childID"), doc2.get("childID"));
+                   doc1.getString("childID"), doc2.getString("childID"));
       // don't compare scores -- they are expected to differ
 
 
@@ -1016,18 +1016,18 @@ public class TestBlockJoin extends Lucen
       final GroupDocs<Integer> group = groupDocs[joinGroupUpto++];
       final ScoreDoc[] groupHits = group.scoreDocs;
       assertNotNull(group.groupValue);
-      final StoredDocument parentDoc = joinR.document(group.groupValue);
-      final String parentID = parentDoc.get("parentID");
+      final Document2 parentDoc = joinR.document(group.groupValue);
+      final String parentID = parentDoc.getString("parentID");
       //System.out.println("GROUP groupDoc=" + group.groupDoc + " parent=" + parentDoc);
       assertNotNull(parentID);
       assertTrue(groupHits.length > 0);
       for(int hitIDX=0;hitIDX<groupHits.length;hitIDX++) {
-        final StoredDocument nonJoinHit = r.document(hits[resultUpto++].doc);
-        final StoredDocument joinHit = joinR.document(groupHits[hitIDX].doc);
+        final Document2 nonJoinHit = r.document(hits[resultUpto++].doc);
+        final Document2 joinHit = joinR.document(groupHits[hitIDX].doc);
         assertEquals(parentID,
-                     nonJoinHit.get("parentID"));
-        assertEquals(joinHit.get("childID"),
-                     nonJoinHit.get("childID"));
+                     nonJoinHit.getString("parentID"));
+        assertEquals(joinHit.getString("childID"),
+                     nonJoinHit.getString("childID"));
       }
 
       if (joinGroupUpto < groupDocs.length) {
@@ -1035,7 +1035,7 @@ public class TestBlockJoin extends Lucen
         //System.out.println("  next joingroupUpto=" + joinGroupUpto + " gd.length=" + groupDocs.length + " parentID=" + parentID);
         while(true) {
           assertTrue(resultUpto < hits.length);
-          if (!parentID.equals(r.document(hits[resultUpto].doc).get("parentID"))) {
+          if (!parentID.equals(r.document(hits[resultUpto].doc).getString("parentID"))) {
             break;
           }
           resultUpto++;
@@ -1104,12 +1104,12 @@ public class TestBlockJoin extends Lucen
     final GroupDocs<Integer> group = jobResults.groups[0];
     assertEquals(1, group.totalHits);
 
-    StoredDocument childJobDoc = s.doc(group.scoreDocs[0].doc);
+    Document2 childJobDoc = s.doc(group.scoreDocs[0].doc);
     //System.out.println("  doc=" + group.scoreDocs[0].doc);
-    assertEquals("java", childJobDoc.get("skill"));
+    assertEquals("java", childJobDoc.getString("skill"));
     assertNotNull(group.groupValue);
-    StoredDocument parentDoc = s.doc(group.groupValue);
-    assertEquals("Lisa", parentDoc.get("name"));
+    Document2 parentDoc = s.doc(group.groupValue);
+    assertEquals("Lisa", parentDoc.getString("name"));
 
     // Now Examine qualification children
     TopGroups<Integer> qualificationResults = c.getTopGroups(childQualificationJoinQuery, null, 0, 10, 0, true);
@@ -1120,11 +1120,11 @@ public class TestBlockJoin extends Lucen
     final GroupDocs<Integer> qGroup = qualificationResults.groups[0];
     assertEquals(1, qGroup.totalHits);
 
-    StoredDocument childQualificationDoc = s.doc(qGroup.scoreDocs[0].doc);
-    assertEquals("maths", childQualificationDoc.get("qualification"));
+    Document2 childQualificationDoc = s.doc(qGroup.scoreDocs[0].doc);
+    assertEquals("maths", childQualificationDoc.getString("qualification"));
     assertNotNull(qGroup.groupValue);
     parentDoc = s.doc(qGroup.groupValue);
-    assertEquals("Lisa", parentDoc.get("name"));
+    assertEquals("Lisa", parentDoc.getString("name"));
 
     r.close();
     dir.close();
@@ -1239,15 +1239,15 @@ public class TestBlockJoin extends Lucen
       assertEquals(2, group.totalHits);
       assertFalse(Float.isNaN(group.score));
       assertNotNull(group.groupValue);
-      StoredDocument parentDoc = s.doc(group.groupValue);
-      assertEquals("Frank", parentDoc.get("name"));
+      Document2 parentDoc = s.doc(group.groupValue);
+      assertEquals("Frank", parentDoc.getString("name"));
 
       assertEquals(2, group.scoreDocs.length); //all matched child documents collected
 
       for (ScoreDoc scoreDoc : group.scoreDocs) {
-        StoredDocument childDoc = s.doc(scoreDoc.doc);
-        assertEquals("java", childDoc.get("skill"));
-        int year = Integer.parseInt(childDoc.get("year"));
+        Document2 childDoc = s.doc(scoreDoc.doc);
+        assertEquals("java", childDoc.getString("skill"));
+        int year = Integer.parseInt(childDoc.getString("year"));
         assertTrue(year >= 2006 && year <= 2011);
       }
     }
@@ -1262,15 +1262,15 @@ public class TestBlockJoin extends Lucen
     assertEquals(2, group.totalHits);
     assertFalse(Float.isNaN(group.score));
     assertNotNull(group.groupValue);
-    StoredDocument parentDoc = s.doc(group.groupValue);
-    assertEquals("Frank", parentDoc.get("name"));
+    Document2 parentDoc = s.doc(group.groupValue);
+    assertEquals("Frank", parentDoc.getString("name"));
 
     assertEquals(1, group.scoreDocs.length); //not all matched child documents collected
 
     for (ScoreDoc scoreDoc : group.scoreDocs) {
-      StoredDocument childDoc = s.doc(scoreDoc.doc);
-      assertEquals("java", childDoc.get("skill"));
-      int year = Integer.parseInt(childDoc.get("year"));
+      Document2 childDoc = s.doc(scoreDoc.doc);
+      assertEquals("java", childDoc.getString("skill"));
+      int year = Integer.parseInt(childDoc.getString("year"));
       assertTrue(year >= 2006 && year <= 2011);
     }
 
@@ -1331,12 +1331,12 @@ public class TestBlockJoin extends Lucen
     assertEquals(1, groups.totalGroupedHitCount);
 
     GroupDocs<Integer> group = groups.groups[0];
-    StoredDocument doc = r.document(group.groupValue.intValue());
-    assertEquals("0", doc.get("parentID"));
+    Document2 doc = r.document(group.groupValue.intValue());
+    assertEquals("0", doc.getString("parentID"));
 
     group = groups.groups[1];
     doc = r.document(group.groupValue.intValue());
-    assertEquals("1", doc.get("parentID"));
+    assertEquals("1", doc.getString("parentID"));
 
     r.close();
     d.close();
@@ -1396,12 +1396,12 @@ public class TestBlockJoin extends Lucen
     assertEquals(0, groups.totalGroupedHitCount);
 
     GroupDocs<Integer> group = groups.groups[0];
-    StoredDocument doc = r.document(group.groupValue.intValue());
-    assertEquals("0", doc.get("parentID"));
+    Document2 doc = r.document(group.groupValue.intValue());
+    assertEquals("0", doc.getString("parentID"));
 
     group = groups.groups[1];
     doc = r.document(group.groupValue.intValue());
-    assertEquals("1", doc.get("parentID"));
+    assertEquals("1", doc.getString("parentID"));
 
     r.close();
     d.close();

Modified: lucene/dev/branches/lucene6005/lucene/memory/src/test/org/apache/lucene/index/memory/TestMemoryIndexAgainstRAMDir.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene6005/lucene/memory/src/test/org/apache/lucene/index/memory/TestMemoryIndexAgainstRAMDir.java?rev=1635898&r1=1635897&r2=1635898&view=diff
==============================================================================
--- lucene/dev/branches/lucene6005/lucene/memory/src/test/org/apache/lucene/index/memory/TestMemoryIndexAgainstRAMDir.java (original)
+++ lucene/dev/branches/lucene6005/lucene/memory/src/test/org/apache/lucene/index/memory/TestMemoryIndexAgainstRAMDir.java Sat Nov  1 08:39:27 2014
@@ -431,7 +431,7 @@ public class TestMemoryIndexAgainstRAMDi
       IndexWriter writer = new IndexWriter(dir, newIndexWriterConfig(random(), mockAnalyzer));
       Document nextDoc = lineFileDocs.nextDoc();
       Document doc = new Document();
-      for (Field field : nextDoc.getFields()) {
+      for (IndexableField field : nextDoc.getFields()) {
         if (field.fieldType().indexOptions() != null) {
           doc.add(field);
           if (random().nextInt(3) == 0) {
@@ -442,7 +442,7 @@ public class TestMemoryIndexAgainstRAMDi
       
       writer.addDocument(doc);
       writer.close();
-      for (IndexableField field : doc.indexableFields()) {
+      for (IndexableField field : doc) {
         memory.addField(field.name(), ((Field)field).stringValue(), mockAnalyzer);  
       }
       DirectoryReader competitor = DirectoryReader.open(dir);

Modified: lucene/dev/branches/lucene6005/lucene/misc/src/java/org/apache/lucene/document/LazyDocument.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene6005/lucene/misc/src/java/org/apache/lucene/document/LazyDocument.java?rev=1635898&r1=1635897&r2=1635898&view=diff
==============================================================================
--- lucene/dev/branches/lucene6005/lucene/misc/src/java/org/apache/lucene/document/LazyDocument.java (original)
+++ lucene/dev/branches/lucene6005/lucene/misc/src/java/org/apache/lucene/document/LazyDocument.java Sat Nov  1 08:39:27 2014
@@ -17,20 +17,19 @@ package org.apache.lucene.document;
  */
 import java.io.IOException;
 import java.io.Reader;
-import java.util.List;
 import java.util.ArrayList;
 import java.util.HashMap;
-import java.util.Map;
 import java.util.HashSet;
+import java.util.List;
+import java.util.Map;
 import java.util.Set;
 
 import org.apache.lucene.analysis.Analyzer;
 import org.apache.lucene.analysis.TokenStream;
 import org.apache.lucene.index.FieldInfo;
 import org.apache.lucene.index.IndexReader;
+import org.apache.lucene.index.IndexableField;
 import org.apache.lucene.index.IndexableFieldType;
-import org.apache.lucene.index.StorableField;
-import org.apache.lucene.index.StoredDocument;
 import org.apache.lucene.util.BytesRef;
 
 /** Defers actually loading a field's value until you ask
@@ -43,7 +42,7 @@ public class LazyDocument {
   private final int docID;
 
   // null until first field is loaded
-  private StoredDocument doc;
+  private Document2 doc;
 
   private Map<Integer,List<LazyField>> fields = new HashMap<>();
   private Set<String> fieldNames = new HashSet<>();
@@ -64,11 +63,11 @@ public class LazyDocument {
    * </p>
    * <p>
    * The lazy loading of field values from all instances of StorableField 
-   * objects returned by this method are all backed by a single StoredDocument 
+   * objects returned by this method are all backed by a single Document2 
    * per LazyDocument instance.
    * </p>
    */
-  public StorableField getField(FieldInfo fieldInfo) {  
+  public IndexableField getField(FieldInfo fieldInfo) {  
 
     fieldNames.add(fieldInfo.name);
     List<LazyField> values = fields.get(fieldInfo.number);
@@ -94,7 +93,7 @@ public class LazyDocument {
    * non-private for test only access
    * @lucene.internal 
    */
-  synchronized StoredDocument getDocument() {
+  synchronized Document2 getDocument() {
     if (doc == null) {
       try {
         doc = reader.document(docID, fieldNames);
@@ -107,18 +106,18 @@ public class LazyDocument {
 
   // :TODO: synchronize to prevent redundent copying? (sync per field name?)
   private void fetchRealValues(String name, int fieldNum) {
-    StoredDocument d = getDocument();
+    Document2 d = getDocument();
 
     List<LazyField> lazyValues = fields.get(fieldNum);
-    StorableField[] realValues = d.getFields(name);
+    List<IndexableField> realValues = d.getFields(name);
     
-    assert realValues.length <= lazyValues.size() 
+    assert realValues.size() <= lazyValues.size() 
       : "More lazy values then real values for field: " + name;
     
     for (int i = 0; i < lazyValues.size(); i++) {
       LazyField f = lazyValues.get(i);
       if (null != f) {
-        f.realValue = realValues[i];
+        f.realValue = realValues.get(i);
       }
     }
   }
@@ -127,10 +126,10 @@ public class LazyDocument {
   /** 
    * @lucene.internal 
    */
-  public class LazyField implements StorableField {
+  public class LazyField implements IndexableField {
     private String name;
     private int fieldNum;
-    volatile StorableField realValue = null;
+    volatile IndexableField realValue = null;
 
     private LazyField(String name, int fieldNum) {
       this.name = name;
@@ -145,7 +144,7 @@ public class LazyDocument {
       return null != realValue;
     }
 
-    private StorableField getRealValue() {
+    private IndexableField getRealValue() {
       if (null == realValue) {
         fetchRealValues(name, fieldNum);
       }
@@ -162,6 +161,16 @@ public class LazyDocument {
     }
 
     @Override
+    public float boost() {
+      return 1.0f;
+    }
+
+    @Override
+    public TokenStream tokenStream(Analyzer analyzer, TokenStream reuse) {
+      return null;
+    }
+
+    @Override
     public BytesRef binaryValue() {
       return getRealValue().binaryValue();
     }

Modified: lucene/dev/branches/lucene6005/lucene/misc/src/test/org/apache/lucene/document/TestLazyDocument.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene6005/lucene/misc/src/test/org/apache/lucene/document/TestLazyDocument.java?rev=1635898&r1=1635897&r2=1635898&view=diff
==============================================================================
--- lucene/dev/branches/lucene6005/lucene/misc/src/test/org/apache/lucene/document/TestLazyDocument.java (original)
+++ lucene/dev/branches/lucene6005/lucene/misc/src/test/org/apache/lucene/document/TestLazyDocument.java Sat Nov  1 08:39:27 2014
@@ -16,19 +16,18 @@
  */
 package org.apache.lucene.document;
 
+import java.io.IOException;
 import java.util.Arrays;
-import java.util.Set;
+import java.util.HashMap;
 import java.util.HashSet;
 import java.util.Map;
-import java.util.HashMap;
-import java.io.IOException;
+import java.util.Set;
 
-import org.apache.lucene.util.LuceneTestCase;
-import org.apache.lucene.store.*;
 import org.apache.lucene.analysis.*;
 import org.apache.lucene.index.*;
 import org.apache.lucene.search.*;
-
+import org.apache.lucene.store.*;
+import org.apache.lucene.util.LuceneTestCase;
 import org.junit.After;
 import org.junit.Before;
 
@@ -87,13 +86,13 @@ public class TestLazyDocument extends Lu
         = new LazyTestingStoredFieldVisitor(new LazyDocument(reader, hits[0].doc),
                                             FIELDS);
       reader.document(hits[0].doc, visitor);
-      StoredDocument d = visitor.doc;
+      Document d = visitor.doc;
 
       int numFieldValues = 0;
       Map<String,Integer> fieldValueCounts = new HashMap<>();
 
       // at this point, all FIELDS should be Lazy and unrealized
-      for (StorableField f : d) {
+      for (IndexableField f : d) {
         numFieldValues++;   
         if (f.name().equals("never_load")) {
           fail("never_load was loaded");
@@ -125,7 +124,7 @@ public class TestLazyDocument extends Lu
 
       // pick a single field name to load a single value
       final String fieldName = FIELDS[random().nextInt(FIELDS.length)];
-      final StorableField[] fieldValues = d.getFields(fieldName);
+      final IndexableField[] fieldValues = d.getFields(fieldName);
       assertEquals("#vals in field: " + fieldName, 
                    NUM_VALUES, fieldValues.length);
       final int valNum = random().nextInt(fieldValues.length);
@@ -133,7 +132,7 @@ public class TestLazyDocument extends Lu
                    fieldValues[valNum].stringValue());
       
       // now every value of fieldName should be loaded
-      for (StorableField f : d) {
+      for (IndexableField f : d) {
         if (f.name().equals("never_load")) {
           fail("never_load was loaded");
         }
@@ -160,7 +159,7 @@ public class TestLazyDocument extends Lu
       // ensure we have all the values we expect now, and that
       // adding one more lazy field didn't "unload" the existing LazyField's
       // we already loaded.
-      for (StorableField f : d) {
+      for (IndexableField f : d) {
         if (f.name().equals("never_load")) {
           fail("never_load was loaded");
         }
@@ -185,7 +184,7 @@ public class TestLazyDocument extends Lu
   }
 
   private static class LazyTestingStoredFieldVisitor extends StoredFieldVisitor {
-    public final StoredDocument doc = new StoredDocument();
+    public final Document doc = new Document();
     public final LazyDocument lazyDoc;
     public final Set<String> lazyFieldNames;
 

Modified: lucene/dev/branches/lucene6005/lucene/misc/src/test/org/apache/lucene/index/TestMultiPassIndexSplitter.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene6005/lucene/misc/src/test/org/apache/lucene/index/TestMultiPassIndexSplitter.java?rev=1635898&r1=1635897&r2=1635898&view=diff
==============================================================================
--- lucene/dev/branches/lucene6005/lucene/misc/src/test/org/apache/lucene/index/TestMultiPassIndexSplitter.java (original)
+++ lucene/dev/branches/lucene6005/lucene/misc/src/test/org/apache/lucene/index/TestMultiPassIndexSplitter.java Sat Nov  1 08:39:27 2014
@@ -18,6 +18,7 @@ package org.apache.lucene.index;
  */
 
 import org.apache.lucene.analysis.MockAnalyzer;
+import org.apache.lucene.document.Document2;
 import org.apache.lucene.document.Document;
 import org.apache.lucene.document.Field;
 import org.apache.lucene.store.Directory;
@@ -70,7 +71,7 @@ public class TestMultiPassIndexSplitter 
     IndexReader ir;
     ir = DirectoryReader.open(dirs[0]);
     assertTrue(ir.numDocs() - NUM_DOCS / 3 <= 1); // rounding error
-    StoredDocument doc = ir.document(0);
+    Document2 doc = ir.document(0);
     assertEquals("0", doc.get("id"));
     TermsEnum te = MultiFields.getTerms(ir, "id").iterator(null);
     assertEquals(TermsEnum.SeekStatus.NOT_FOUND, te.seekCeil(new BytesRef("1")));
@@ -115,8 +116,8 @@ public class TestMultiPassIndexSplitter 
     IndexReader ir;
     ir = DirectoryReader.open(dirs[0]);
     assertTrue(ir.numDocs() - NUM_DOCS / 3 <= 1);
-    StoredDocument doc = ir.document(0);
-    assertEquals("0", doc.get("id"));
+    Document2 doc = ir.document(0);
+    assertEquals("0", doc.getString("id"));
     int start = ir.numDocs();
     ir.close();
     ir = DirectoryReader.open(dirs[1]);

Modified: lucene/dev/branches/lucene6005/lucene/misc/src/test/org/apache/lucene/index/sorter/IndexSortingTest.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene6005/lucene/misc/src/test/org/apache/lucene/index/sorter/IndexSortingTest.java?rev=1635898&r1=1635897&r2=1635898&view=diff
==============================================================================
--- lucene/dev/branches/lucene6005/lucene/misc/src/test/org/apache/lucene/index/sorter/IndexSortingTest.java (original)
+++ lucene/dev/branches/lucene6005/lucene/misc/src/test/org/apache/lucene/index/sorter/IndexSortingTest.java Sat Nov  1 08:39:27 2014
@@ -49,7 +49,7 @@ public class IndexSortingTest extends So
     List<Integer> values = new ArrayList<>();
     for (int i = 0; i < unsortedReader.maxDoc(); i++) {
       if (liveDocs == null || liveDocs.get(i)) {
-        values.add(Integer.valueOf(unsortedReader.document(i).get(ID_FIELD)));
+        values.add(Integer.valueOf(unsortedReader.document(i).getString(ID_FIELD)));
       }
     }
     int idx = random().nextInt(SORT.length);

Modified: lucene/dev/branches/lucene6005/lucene/misc/src/test/org/apache/lucene/index/sorter/SorterTestBase.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene6005/lucene/misc/src/test/org/apache/lucene/index/sorter/SorterTestBase.java?rev=1635898&r1=1635897&r2=1635898&view=diff
==============================================================================
--- lucene/dev/branches/lucene6005/lucene/misc/src/test/org/apache/lucene/index/sorter/SorterTestBase.java (original)
+++ lucene/dev/branches/lucene6005/lucene/misc/src/test/org/apache/lucene/index/sorter/SorterTestBase.java Sat Nov  1 08:39:27 2014
@@ -321,7 +321,7 @@ public abstract class SorterTestBase ext
     int prev = -1;
     while ((doc = docs.nextDoc()) != DocIdSetIterator.NO_MORE_DOCS) {
       assertTrue("document " + doc + " marked as deleted", mappedLiveDocs == null || mappedLiveDocs.get(doc));
-      assertEquals("incorrect value; doc " + doc, sortedValues[doc].intValue(), Integer.parseInt(sortedReader.document(doc).get(ID_FIELD)));
+      assertEquals("incorrect value; doc " + doc, sortedValues[doc].intValue(), Integer.parseInt(sortedReader.document(doc).getString(ID_FIELD)));
       while (++prev < doc) {
         assertFalse("document " + prev + " not marked as deleted", mappedLiveDocs == null || mappedLiveDocs.get(prev));
       }
@@ -339,7 +339,7 @@ public abstract class SorterTestBase ext
     prev = -1;
     while ((doc = docs.advance(doc + 1)) != DocIdSetIterator.NO_MORE_DOCS) {
       assertTrue("document " + doc + " marked as deleted", mappedLiveDocs == null || mappedLiveDocs.get(doc));
-      assertEquals("incorrect value; doc " + doc, sortedValues[doc].intValue(), Integer.parseInt(sortedReader.document(doc).get(ID_FIELD)));
+      assertEquals("incorrect value; doc " + doc, sortedValues[doc].intValue(), Integer.parseInt(sortedReader.document(doc).getString(ID_FIELD)));
       while (++prev < doc) {
         assertFalse("document " + prev + " not marked as deleted", mappedLiveDocs == null || mappedLiveDocs.get(prev));
       }

Modified: lucene/dev/branches/lucene6005/lucene/misc/src/test/org/apache/lucene/uninverting/TestFieldCacheSort.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene6005/lucene/misc/src/test/org/apache/lucene/uninverting/TestFieldCacheSort.java?rev=1635898&r1=1635897&r2=1635898&view=diff
==============================================================================
--- lucene/dev/branches/lucene6005/lucene/misc/src/test/org/apache/lucene/uninverting/TestFieldCacheSort.java (original)
+++ lucene/dev/branches/lucene6005/lucene/misc/src/test/org/apache/lucene/uninverting/TestFieldCacheSort.java Sat Nov  1 08:39:27 2014
@@ -85,8 +85,8 @@ public class TestFieldCacheSort extends 
     TopDocs td = searcher.search(new MatchAllDocsQuery(), 10, sort);
     assertEquals(2, td.totalHits);
     // 'bar' comes before 'foo'
-    assertEquals("bar", searcher.doc(td.scoreDocs[0].doc).get("value"));
-    assertEquals("foo", searcher.doc(td.scoreDocs[1].doc).get("value"));
+    assertEquals("bar", searcher.doc(td.scoreDocs[0].doc).getString("value"));
+    assertEquals("foo", searcher.doc(td.scoreDocs[1].doc).getString("value"));
 
     TestUtil.checkReader(ir);
     ir.close();
@@ -124,9 +124,9 @@ public class TestFieldCacheSort extends 
     TopDocs td = searcher.search(new MatchAllDocsQuery(), 10, sort);
     assertEquals(3, td.totalHits);
     // null comes first
-    assertNull(searcher.doc(td.scoreDocs[0].doc).get("value"));
-    assertEquals("bar", searcher.doc(td.scoreDocs[1].doc).get("value"));
-    assertEquals("foo", searcher.doc(td.scoreDocs[2].doc).get("value"));
+    assertNull(searcher.doc(td.scoreDocs[0].doc).getString("value"));
+    assertEquals("bar", searcher.doc(td.scoreDocs[1].doc).getString("value"));
+    assertEquals("foo", searcher.doc(td.scoreDocs[2].doc).getString("value"));
     TestUtil.checkReader(ir);
     ir.close();
     dir.close();
@@ -161,8 +161,8 @@ public class TestFieldCacheSort extends 
     TopDocs td = searcher.search(new MatchAllDocsQuery(), 10, sort);
     assertEquals(2, td.totalHits);
     // 'foo' comes after 'bar' in reverse order
-    assertEquals("foo", searcher.doc(td.scoreDocs[0].doc).get("value"));
-    assertEquals("bar", searcher.doc(td.scoreDocs[1].doc).get("value"));
+    assertEquals("foo", searcher.doc(td.scoreDocs[0].doc).getString("value"));
+    assertEquals("bar", searcher.doc(td.scoreDocs[1].doc).getString("value"));
     TestUtil.checkReader(ir);
     ir.close();
     dir.close();
@@ -201,9 +201,9 @@ public class TestFieldCacheSort extends 
     TopDocs td = searcher.search(new MatchAllDocsQuery(), 10, sort);
     assertEquals(3, td.totalHits);
     // null comes first
-    assertNull(searcher.doc(td.scoreDocs[0].doc).get("value"));
-    assertEquals("bar", searcher.doc(td.scoreDocs[1].doc).get("value"));
-    assertEquals("foo", searcher.doc(td.scoreDocs[2].doc).get("value"));
+    assertNull(searcher.doc(td.scoreDocs[0].doc).getString("value"));
+    assertEquals("bar", searcher.doc(td.scoreDocs[1].doc).getString("value"));
+    assertEquals("foo", searcher.doc(td.scoreDocs[2].doc).getString("value"));
     TestUtil.checkReader(ir);
     ir.close();
     dir.close();
@@ -241,10 +241,10 @@ public class TestFieldCacheSort extends 
 
     TopDocs td = searcher.search(new MatchAllDocsQuery(), 10, sort);
     assertEquals(3, td.totalHits);
-    assertEquals("foo", searcher.doc(td.scoreDocs[0].doc).get("value"));
-    assertEquals("bar", searcher.doc(td.scoreDocs[1].doc).get("value"));
+    assertEquals("foo", searcher.doc(td.scoreDocs[0].doc).getString("value"));
+    assertEquals("bar", searcher.doc(td.scoreDocs[1].doc).getString("value"));
     // null comes last
-    assertNull(searcher.doc(td.scoreDocs[2].doc).get("value"));
+    assertNull(searcher.doc(td.scoreDocs[2].doc).getString("value"));
     TestUtil.checkReader(ir);
     ir.close();
     dir.close();
@@ -283,10 +283,10 @@ public class TestFieldCacheSort extends 
 
     TopDocs td = searcher.search(new MatchAllDocsQuery(), 10, sort);
     assertEquals(3, td.totalHits);
-    assertEquals("bar", searcher.doc(td.scoreDocs[0].doc).get("value"));
-    assertEquals("foo", searcher.doc(td.scoreDocs[1].doc).get("value"));
+    assertEquals("bar", searcher.doc(td.scoreDocs[0].doc).getString("value"));
+    assertEquals("foo", searcher.doc(td.scoreDocs[1].doc).getString("value"));
     // null comes last
-    assertNull(searcher.doc(td.scoreDocs[2].doc).get("value"));
+    assertNull(searcher.doc(td.scoreDocs[2].doc).getString("value"));
     TestUtil.checkReader(ir);
     ir.close();
     dir.close();
@@ -326,9 +326,9 @@ public class TestFieldCacheSort extends 
     TopDocs td = searcher.search(new MatchAllDocsQuery(), 10, sort);
     assertEquals(3, td.totalHits);
     // null comes first
-    assertNull(searcher.doc(td.scoreDocs[0].doc).get("value"));
-    assertEquals("foo", searcher.doc(td.scoreDocs[1].doc).get("value"));
-    assertEquals("bar", searcher.doc(td.scoreDocs[2].doc).get("value"));
+    assertNull(searcher.doc(td.scoreDocs[0].doc).getString("value"));
+    assertEquals("foo", searcher.doc(td.scoreDocs[1].doc).getString("value"));
+    assertEquals("bar", searcher.doc(td.scoreDocs[2].doc).getString("value"));
     TestUtil.checkReader(ir);
     ir.close();
     dir.close();
@@ -468,9 +468,9 @@ public class TestFieldCacheSort extends 
     TopDocs td = searcher.search(new MatchAllDocsQuery(), 10, sort);
     assertEquals(3, td.totalHits);
     // numeric order
-    assertEquals("-1", searcher.doc(td.scoreDocs[0].doc).get("value"));
-    assertEquals("4", searcher.doc(td.scoreDocs[1].doc).get("value"));
-    assertEquals("300000", searcher.doc(td.scoreDocs[2].doc).get("value"));
+    assertEquals("-1", searcher.doc(td.scoreDocs[0].doc).getString("value"));
+    assertEquals("4", searcher.doc(td.scoreDocs[1].doc).getString("value"));
+    assertEquals("300000", searcher.doc(td.scoreDocs[2].doc).getString("value"));
     TestUtil.checkReader(ir);
     ir.close();
     dir.close();
@@ -498,9 +498,9 @@ public class TestFieldCacheSort extends 
     TopDocs td = searcher.search(new MatchAllDocsQuery(), 10, sort);
     assertEquals(3, td.totalHits);
     // null is treated as a 0
-    assertEquals("-1", searcher.doc(td.scoreDocs[0].doc).get("value"));
-    assertNull(searcher.doc(td.scoreDocs[1].doc).get("value"));
-    assertEquals("4", searcher.doc(td.scoreDocs[2].doc).get("value"));
+    assertEquals("-1", searcher.doc(td.scoreDocs[0].doc).getString("value"));
+    assertNull(searcher.doc(td.scoreDocs[1].doc).getString("value"));
+    assertEquals("4", searcher.doc(td.scoreDocs[2].doc).getString("value"));
     TestUtil.checkReader(ir);
     ir.close();
     dir.close();
@@ -530,9 +530,9 @@ public class TestFieldCacheSort extends 
     TopDocs td = searcher.search(new MatchAllDocsQuery(), 10, sort);
     assertEquals(3, td.totalHits);
     // null is treated as a Integer.MAX_VALUE
-    assertEquals("-1", searcher.doc(td.scoreDocs[0].doc).get("value"));
-    assertEquals("4", searcher.doc(td.scoreDocs[1].doc).get("value"));
-    assertNull(searcher.doc(td.scoreDocs[2].doc).get("value"));
+    assertEquals("-1", searcher.doc(td.scoreDocs[0].doc).getString("value"));
+    assertEquals("4", searcher.doc(td.scoreDocs[1].doc).getString("value"));
+    assertNull(searcher.doc(td.scoreDocs[2].doc).getString("value"));
     TestUtil.checkReader(ir);
     ir.close();
     dir.close();
@@ -561,9 +561,9 @@ public class TestFieldCacheSort extends 
     TopDocs td = searcher.search(new MatchAllDocsQuery(), 10, sort);
     assertEquals(3, td.totalHits);
     // reverse numeric order
-    assertEquals("300000", searcher.doc(td.scoreDocs[0].doc).get("value"));
-    assertEquals("4", searcher.doc(td.scoreDocs[1].doc).get("value"));
-    assertEquals("-1", searcher.doc(td.scoreDocs[2].doc).get("value"));
+    assertEquals("300000", searcher.doc(td.scoreDocs[0].doc).getString("value"));
+    assertEquals("4", searcher.doc(td.scoreDocs[1].doc).getString("value"));
+    assertEquals("-1", searcher.doc(td.scoreDocs[2].doc).getString("value"));
     TestUtil.checkReader(ir);
     ir.close();
     dir.close();
@@ -592,9 +592,9 @@ public class TestFieldCacheSort extends 
     TopDocs td = searcher.search(new MatchAllDocsQuery(), 10, sort);
     assertEquals(3, td.totalHits);
     // numeric order
-    assertEquals("-1", searcher.doc(td.scoreDocs[0].doc).get("value"));
-    assertEquals("4", searcher.doc(td.scoreDocs[1].doc).get("value"));
-    assertEquals("3000000000", searcher.doc(td.scoreDocs[2].doc).get("value"));
+    assertEquals("-1", searcher.doc(td.scoreDocs[0].doc).getString("value"));
+    assertEquals("4", searcher.doc(td.scoreDocs[1].doc).getString("value"));
+    assertEquals("3000000000", searcher.doc(td.scoreDocs[2].doc).getString("value"));
     TestUtil.checkReader(ir);
     ir.close();
     dir.close();
@@ -622,9 +622,9 @@ public class TestFieldCacheSort extends 
     TopDocs td = searcher.search(new MatchAllDocsQuery(), 10, sort);
     assertEquals(3, td.totalHits);
     // null is treated as 0
-    assertEquals("-1", searcher.doc(td.scoreDocs[0].doc).get("value"));
-    assertNull(searcher.doc(td.scoreDocs[1].doc).get("value"));
-    assertEquals("4", searcher.doc(td.scoreDocs[2].doc).get("value"));
+    assertEquals("-1", searcher.doc(td.scoreDocs[0].doc).getString("value"));
+    assertNull(searcher.doc(td.scoreDocs[1].doc).getString("value"));
+    assertEquals("4", searcher.doc(td.scoreDocs[2].doc).getString("value"));
     TestUtil.checkReader(ir);
     ir.close();
     dir.close();
@@ -654,9 +654,9 @@ public class TestFieldCacheSort extends 
     TopDocs td = searcher.search(new MatchAllDocsQuery(), 10, sort);
     assertEquals(3, td.totalHits);
     // null is treated as Long.MAX_VALUE
-    assertEquals("-1", searcher.doc(td.scoreDocs[0].doc).get("value"));
-    assertEquals("4", searcher.doc(td.scoreDocs[1].doc).get("value"));
-    assertNull(searcher.doc(td.scoreDocs[2].doc).get("value"));
+    assertEquals("-1", searcher.doc(td.scoreDocs[0].doc).getString("value"));
+    assertEquals("4", searcher.doc(td.scoreDocs[1].doc).getString("value"));
+    assertNull(searcher.doc(td.scoreDocs[2].doc).getString("value"));
     TestUtil.checkReader(ir);
     ir.close();
     dir.close();
@@ -685,9 +685,9 @@ public class TestFieldCacheSort extends 
     TopDocs td = searcher.search(new MatchAllDocsQuery(), 10, sort);
     assertEquals(3, td.totalHits);
     // reverse numeric order
-    assertEquals("3000000000", searcher.doc(td.scoreDocs[0].doc).get("value"));
-    assertEquals("4", searcher.doc(td.scoreDocs[1].doc).get("value"));
-    assertEquals("-1", searcher.doc(td.scoreDocs[2].doc).get("value"));
+    assertEquals("3000000000", searcher.doc(td.scoreDocs[0].doc).getString("value"));
+    assertEquals("4", searcher.doc(td.scoreDocs[1].doc).getString("value"));
+    assertEquals("-1", searcher.doc(td.scoreDocs[2].doc).getString("value"));
     TestUtil.checkReader(ir);
     ir.close();
     dir.close();
@@ -716,9 +716,9 @@ public class TestFieldCacheSort extends 
     TopDocs td = searcher.search(new MatchAllDocsQuery(), 10, sort);
     assertEquals(3, td.totalHits);
     // numeric order
-    assertEquals("-1.3", searcher.doc(td.scoreDocs[0].doc).get("value"));
-    assertEquals("4.2", searcher.doc(td.scoreDocs[1].doc).get("value"));
-    assertEquals("30.1", searcher.doc(td.scoreDocs[2].doc).get("value"));
+    assertEquals("-1.3", searcher.doc(td.scoreDocs[0].doc).getString("value"));
+    assertEquals("4.2", searcher.doc(td.scoreDocs[1].doc).getString("value"));
+    assertEquals("30.1", searcher.doc(td.scoreDocs[2].doc).getString("value"));
     TestUtil.checkReader(ir);
     ir.close();
     dir.close();
@@ -746,9 +746,9 @@ public class TestFieldCacheSort extends 
     TopDocs td = searcher.search(new MatchAllDocsQuery(), 10, sort);
     assertEquals(3, td.totalHits);
     // null is treated as 0
-    assertEquals("-1.3", searcher.doc(td.scoreDocs[0].doc).get("value"));
-    assertNull(searcher.doc(td.scoreDocs[1].doc).get("value"));
-    assertEquals("4.2", searcher.doc(td.scoreDocs[2].doc).get("value"));
+    assertEquals("-1.3", searcher.doc(td.scoreDocs[0].doc).getString("value"));
+    assertNull(searcher.doc(td.scoreDocs[1].doc).getString("value"));
+    assertEquals("4.2", searcher.doc(td.scoreDocs[2].doc).getString("value"));
     TestUtil.checkReader(ir);
     ir.close();
     dir.close();
@@ -778,9 +778,9 @@ public class TestFieldCacheSort extends 
     TopDocs td = searcher.search(new MatchAllDocsQuery(), 10, sort);
     assertEquals(3, td.totalHits);
     // null is treated as Float.MAX_VALUE
-    assertEquals("-1.3", searcher.doc(td.scoreDocs[0].doc).get("value"));
-    assertEquals("4.2", searcher.doc(td.scoreDocs[1].doc).get("value"));
-    assertNull(searcher.doc(td.scoreDocs[2].doc).get("value"));
+    assertEquals("-1.3", searcher.doc(td.scoreDocs[0].doc).getString("value"));
+    assertEquals("4.2", searcher.doc(td.scoreDocs[1].doc).getString("value"));
+    assertNull(searcher.doc(td.scoreDocs[2].doc).getString("value"));
     TestUtil.checkReader(ir);
     ir.close();
     dir.close();
@@ -809,9 +809,9 @@ public class TestFieldCacheSort extends 
     TopDocs td = searcher.search(new MatchAllDocsQuery(), 10, sort);
     assertEquals(3, td.totalHits);
     // reverse numeric order
-    assertEquals("30.1", searcher.doc(td.scoreDocs[0].doc).get("value"));
-    assertEquals("4.2", searcher.doc(td.scoreDocs[1].doc).get("value"));
-    assertEquals("-1.3", searcher.doc(td.scoreDocs[2].doc).get("value"));
+    assertEquals("30.1", searcher.doc(td.scoreDocs[0].doc).getString("value"));
+    assertEquals("4.2", searcher.doc(td.scoreDocs[1].doc).getString("value"));
+    assertEquals("-1.3", searcher.doc(td.scoreDocs[2].doc).getString("value"));
     TestUtil.checkReader(ir);
     ir.close();
     dir.close();
@@ -843,10 +843,10 @@ public class TestFieldCacheSort extends 
     TopDocs td = searcher.search(new MatchAllDocsQuery(), 10, sort);
     assertEquals(4, td.totalHits);
     // numeric order
-    assertEquals("-1.3", searcher.doc(td.scoreDocs[0].doc).get("value"));
-    assertEquals("4.2333333333332", searcher.doc(td.scoreDocs[1].doc).get("value"));
-    assertEquals("4.2333333333333", searcher.doc(td.scoreDocs[2].doc).get("value"));
-    assertEquals("30.1", searcher.doc(td.scoreDocs[3].doc).get("value"));
+    assertEquals("-1.3", searcher.doc(td.scoreDocs[0].doc).getString("value"));
+    assertEquals("4.2333333333332", searcher.doc(td.scoreDocs[1].doc).getString("value"));
+    assertEquals("4.2333333333333", searcher.doc(td.scoreDocs[2].doc).getString("value"));
+    assertEquals("30.1", searcher.doc(td.scoreDocs[3].doc).getString("value"));
     TestUtil.checkReader(ir);
     ir.close();
     dir.close();
@@ -910,10 +910,10 @@ public class TestFieldCacheSort extends 
     TopDocs td = searcher.search(new MatchAllDocsQuery(), 10, sort);
     assertEquals(4, td.totalHits);
     // null treated as a 0
-    assertEquals("-1.3", searcher.doc(td.scoreDocs[0].doc).get("value"));
-    assertNull(searcher.doc(td.scoreDocs[1].doc).get("value"));
-    assertEquals("4.2333333333332", searcher.doc(td.scoreDocs[2].doc).get("value"));
-    assertEquals("4.2333333333333", searcher.doc(td.scoreDocs[3].doc).get("value"));
+    assertEquals("-1.3", searcher.doc(td.scoreDocs[0].doc).getString("value"));
+    assertNull(searcher.doc(td.scoreDocs[1].doc).getString("value"));
+    assertEquals("4.2333333333332", searcher.doc(td.scoreDocs[2].doc).getString("value"));
+    assertEquals("4.2333333333333", searcher.doc(td.scoreDocs[3].doc).getString("value"));
     TestUtil.checkReader(ir);
     ir.close();
     dir.close();
@@ -946,10 +946,10 @@ public class TestFieldCacheSort extends 
     TopDocs td = searcher.search(new MatchAllDocsQuery(), 10, sort);
     assertEquals(4, td.totalHits);
     // null treated as Double.MAX_VALUE
-    assertEquals("-1.3", searcher.doc(td.scoreDocs[0].doc).get("value"));
-    assertEquals("4.2333333333332", searcher.doc(td.scoreDocs[1].doc).get("value"));
-    assertEquals("4.2333333333333", searcher.doc(td.scoreDocs[2].doc).get("value"));
-    assertNull(searcher.doc(td.scoreDocs[3].doc).get("value"));
+    assertEquals("-1.3", searcher.doc(td.scoreDocs[0].doc).getString("value"));
+    assertEquals("4.2333333333332", searcher.doc(td.scoreDocs[1].doc).getString("value"));
+    assertEquals("4.2333333333333", searcher.doc(td.scoreDocs[2].doc).getString("value"));
+    assertNull(searcher.doc(td.scoreDocs[3].doc).getString("value"));
     TestUtil.checkReader(ir);
     ir.close();
     dir.close();
@@ -981,10 +981,10 @@ public class TestFieldCacheSort extends 
     TopDocs td = searcher.search(new MatchAllDocsQuery(), 10, sort);
     assertEquals(4, td.totalHits);
     // numeric order
-    assertEquals("30.1", searcher.doc(td.scoreDocs[0].doc).get("value"));
-    assertEquals("4.2333333333333", searcher.doc(td.scoreDocs[1].doc).get("value"));
-    assertEquals("4.2333333333332", searcher.doc(td.scoreDocs[2].doc).get("value"));
-    assertEquals("-1.3", searcher.doc(td.scoreDocs[3].doc).get("value"));
+    assertEquals("30.1", searcher.doc(td.scoreDocs[0].doc).getString("value"));
+    assertEquals("4.2333333333333", searcher.doc(td.scoreDocs[1].doc).getString("value"));
+    assertEquals("4.2333333333332", searcher.doc(td.scoreDocs[2].doc).getString("value"));
+    assertEquals("-1.3", searcher.doc(td.scoreDocs[3].doc).getString("value"));
     TestUtil.checkReader(ir);
     ir.close();
     dir.close();
@@ -1124,7 +1124,7 @@ public class TestFieldCacheSort extends 
 
     TopDocs td = searcher.search(new MatchAllDocsQuery(), 10, sort);
     assertEquals(1, td.totalHits);
-    assertEquals("foo", searcher.doc(td.scoreDocs[0].doc).get("value"));
+    assertEquals("foo", searcher.doc(td.scoreDocs[0].doc).getString("value"));
     TestUtil.checkReader(ir);
     ir.close();
     dir.close();
@@ -1182,8 +1182,8 @@ public class TestFieldCacheSort extends 
     TopDocs td = searcher.search(new MatchAllDocsQuery(), 10, sort);
     assertEquals(2, td.totalHits);
     // 'bar' comes before 'foo'
-    assertEquals("bar", searcher.doc(td.scoreDocs[0].doc).get("value"));
-    assertEquals("foo", searcher.doc(td.scoreDocs[1].doc).get("value"));
+    assertEquals("bar", searcher.doc(td.scoreDocs[0].doc).getString("value"));
+    assertEquals("foo", searcher.doc(td.scoreDocs[1].doc).getString("value"));
     TestUtil.checkReader(ir);
     ir.close();
     dir.close();



Mime
View raw message