lucene-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mikemcc...@apache.org
Subject svn commit: r1635898 [6/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/misc/src/test/org/apache/lucene/uninverting/TestFieldCacheVsDocValues.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene6005/lucene/misc/src/test/org/apache/lucene/uninverting/TestFieldCacheVsDocValues.java?rev=1635898&r1=1635897&r2=1635898&view=diff
==============================================================================
--- lucene/dev/branches/lucene6005/lucene/misc/src/test/org/apache/lucene/uninverting/TestFieldCacheVsDocValues.java (original)
+++ lucene/dev/branches/lucene6005/lucene/misc/src/test/org/apache/lucene/uninverting/TestFieldCacheVsDocValues.java Sat Nov  1 08:39:27 2014
@@ -17,8 +17,6 @@ package org.apache.lucene.uninverting;
  * limitations under the License.
  */
 
-import static org.apache.lucene.index.SortedSetDocValues.NO_MORE_ORDS;
-
 import java.util.ArrayList;
 import java.util.Collections;
 import java.util.List;
@@ -26,33 +24,35 @@ import java.util.List;
 import org.apache.lucene.analysis.Analyzer;
 import org.apache.lucene.analysis.MockAnalyzer;
 import org.apache.lucene.document.BinaryDocValuesField;
+import org.apache.lucene.document.Document2;
 import org.apache.lucene.document.Document;
 import org.apache.lucene.document.Field;
 import org.apache.lucene.document.NumericDocValuesField;
 import org.apache.lucene.document.SortedDocValuesField;
 import org.apache.lucene.document.SortedSetDocValuesField;
 import org.apache.lucene.document.StringField;
-import org.apache.lucene.index.LeafReader;
-import org.apache.lucene.index.LeafReaderContext;
 import org.apache.lucene.index.BinaryDocValues;
 import org.apache.lucene.index.DirectoryReader;
 import org.apache.lucene.index.DocValues;
 import org.apache.lucene.index.IndexWriter;
 import org.apache.lucene.index.IndexWriterConfig;
+import org.apache.lucene.index.LeafReader;
+import org.apache.lucene.index.LeafReaderContext;
 import org.apache.lucene.index.RandomIndexWriter;
 import org.apache.lucene.index.SlowCompositeReaderWrapper;
 import org.apache.lucene.index.SortedDocValues;
 import org.apache.lucene.index.SortedSetDocValues;
-import org.apache.lucene.index.StoredDocument;
 import org.apache.lucene.index.Term;
-import org.apache.lucene.index.TermsEnum;
 import org.apache.lucene.index.TermsEnum.SeekStatus;
+import org.apache.lucene.index.TermsEnum;
 import org.apache.lucene.store.Directory;
 import org.apache.lucene.util.Bits;
 import org.apache.lucene.util.BytesRef;
 import org.apache.lucene.util.LuceneTestCase;
 import org.apache.lucene.util.TestUtil;
 
+import static org.apache.lucene.index.SortedSetDocValues.NO_MORE_ORDS;
+
 public class TestFieldCacheVsDocValues extends LuceneTestCase {
   
   public void testByteMissingVsFieldCache() throws Exception {
@@ -195,9 +195,9 @@ public class TestFieldCacheVsDocValues e
 
     BinaryDocValues s = FieldCache.DEFAULT.getTerms(ar, "field", false);
     for(int docID=0;docID<docBytes.size();docID++) {
-      StoredDocument doc = ar.document(docID);
+      Document2 doc = ar.document(docID);
       BytesRef bytes = s.get(docID);
-      byte[] expected = docBytes.get(Integer.parseInt(doc.get("id")));
+      byte[] expected = docBytes.get(Integer.parseInt(doc.getString("id")));
       assertEquals(expected.length, bytes.length);
       assertEquals(new BytesRef(expected), bytes);
     }
@@ -268,9 +268,9 @@ public class TestFieldCacheVsDocValues e
 
     BinaryDocValues s = FieldCache.DEFAULT.getTerms(ar, "field", false);
     for(int docID=0;docID<docBytes.size();docID++) {
-      StoredDocument doc = ar.document(docID);
+      Document2 doc = ar.document(docID);
       BytesRef bytes = s.get(docID);
-      byte[] expected = docBytes.get(Integer.parseInt(doc.get("id")));
+      byte[] expected = docBytes.get(Integer.parseInt(doc.getString("id")));
       assertEquals(expected.length, bytes.length);
       assertEquals(new BytesRef(expected), bytes);
     }

Modified: lucene/dev/branches/lucene6005/lucene/queries/src/java/org/apache/lucene/queries/mlt/MoreLikeThis.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene6005/lucene/queries/src/java/org/apache/lucene/queries/mlt/MoreLikeThis.java?rev=1635898&r1=1635897&r2=1635898&view=diff
==============================================================================
--- lucene/dev/branches/lucene6005/lucene/queries/src/java/org/apache/lucene/queries/mlt/MoreLikeThis.java (original)
+++ lucene/dev/branches/lucene6005/lucene/queries/src/java/org/apache/lucene/queries/mlt/MoreLikeThis.java Sat Nov  1 08:39:27 2014
@@ -15,14 +15,23 @@
  */
 package org.apache.lucene.queries.mlt;
 
+import java.io.IOException;
+import java.io.Reader;
+import java.io.StringReader;
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.HashMap;
+import java.util.Map;
+import java.util.Set;
+
 import org.apache.lucene.analysis.Analyzer;
 import org.apache.lucene.analysis.TokenStream;
 import org.apache.lucene.analysis.tokenattributes.CharTermAttribute;
+import org.apache.lucene.document.Document2;
 import org.apache.lucene.index.Fields;
 import org.apache.lucene.index.IndexReader;
+import org.apache.lucene.index.IndexableField;
 import org.apache.lucene.index.MultiFields;
-import org.apache.lucene.index.StorableField;
-import org.apache.lucene.index.StoredDocument;
 import org.apache.lucene.index.Term;
 import org.apache.lucene.index.Terms;
 import org.apache.lucene.index.TermsEnum;
@@ -38,15 +47,6 @@ import org.apache.lucene.util.CharsRefBu
 import org.apache.lucene.util.PriorityQueue;
 import org.apache.lucene.util.UnicodeUtil;
 
-import java.io.IOException;
-import java.io.Reader;
-import java.io.StringReader;
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.HashMap;
-import java.util.Map;
-import java.util.Set;
-
 
 /**
  * Generate "more like this" similarity queries.
@@ -725,9 +725,8 @@ public final class MoreLikeThis {
 
       // field does not store term vector info
       if (vector == null) {
-        StoredDocument d = ir.document(docNum);
-        StorableField[] fields = d.getFields(fieldName);
-        for (StorableField field : fields) {
+        Document2 d = ir.document(docNum);
+        for (IndexableField field : d.getFields(fieldName)) {
           final String stringValue = field.stringValue();
           if (stringValue != null) {
             addTermFrequencies(new StringReader(stringValue), termFreqMap, fieldName);

Modified: lucene/dev/branches/lucene6005/lucene/queries/src/test/org/apache/lucene/queries/TestCustomScoreQuery.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene6005/lucene/queries/src/test/org/apache/lucene/queries/TestCustomScoreQuery.java?rev=1635898&r1=1635897&r2=1635898&view=diff
==============================================================================
--- lucene/dev/branches/lucene6005/lucene/queries/src/test/org/apache/lucene/queries/TestCustomScoreQuery.java (original)
+++ lucene/dev/branches/lucene6005/lucene/queries/src/test/org/apache/lucene/queries/TestCustomScoreQuery.java Sat Nov  1 08:39:27 2014
@@ -305,7 +305,7 @@ public class TestCustomScoreQuery extend
 
       log("doc = "+doc);
 
-      float fieldScore = expectedFieldScore(s.getIndexReader().document(doc).get(ID_FIELD));
+      float fieldScore = expectedFieldScore(s.getIndexReader().document(doc).getString(ID_FIELD));
       log("fieldScore = " + fieldScore);
       assertTrue("fieldScore should not be 0", fieldScore > 0);
 

Modified: lucene/dev/branches/lucene6005/lucene/queries/src/test/org/apache/lucene/queries/function/TestFieldScoreQuery.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene6005/lucene/queries/src/test/org/apache/lucene/queries/function/TestFieldScoreQuery.java?rev=1635898&r1=1635897&r2=1635898&view=diff
==============================================================================
--- lucene/dev/branches/lucene6005/lucene/queries/src/test/org/apache/lucene/queries/function/TestFieldScoreQuery.java (original)
+++ lucene/dev/branches/lucene6005/lucene/queries/src/test/org/apache/lucene/queries/function/TestFieldScoreQuery.java Sat Nov  1 08:39:27 2014
@@ -68,7 +68,7 @@ public class TestFieldScoreQuery extends
     assertEquals("All docs should be matched!",N_DOCS,h.length);
     String prevID = "ID"+(N_DOCS+1); // greater than all ids of docs in this test
     for (int i=0; i<h.length; i++) {
-      String resID = s.doc(h[i].doc).get(ID_FIELD);
+      String resID = s.doc(h[i].doc).getString(ID_FIELD);
       log(i+".   score="+h[i].score+"  -  "+resID);
       log(s.explain(functionQuery,h[i].doc));
       assertTrue("res id "+resID+" should be < prev res id "+prevID, resID.compareTo(prevID)<0);
@@ -101,7 +101,7 @@ public class TestFieldScoreQuery extends
     for (ScoreDoc aSd : sd) {
       float score = aSd.score;
       log(s.explain(functionQuery, aSd.doc));
-      String id = s.getIndexReader().document(aSd.doc).get(ID_FIELD);
+      String id = s.getIndexReader().document(aSd.doc).getString(ID_FIELD);
       float expectedScore = expectedFieldScore(id); // "ID7" --> 7.0
       assertEquals("score of " + id + " shuould be " + expectedScore + " != " + score, expectedScore, score, TEST_SCORE_TOLERANCE_DELTA);
     }

Modified: lucene/dev/branches/lucene6005/lucene/queries/src/test/org/apache/lucene/queries/function/TestFunctionQuerySort.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene6005/lucene/queries/src/test/org/apache/lucene/queries/function/TestFunctionQuerySort.java?rev=1635898&r1=1635897&r2=1635898&view=diff
==============================================================================
--- lucene/dev/branches/lucene6005/lucene/queries/src/test/org/apache/lucene/queries/function/TestFunctionQuerySort.java (original)
+++ lucene/dev/branches/lucene6005/lucene/queries/src/test/org/apache/lucene/queries/function/TestFunctionQuerySort.java Sat Nov  1 08:39:27 2014
@@ -79,7 +79,7 @@ public class TestFunctionQuerySort exten
     // Verify that sorting works in general
     int i = 0;
     for (ScoreDoc hit : hits.scoreDocs) {
-      int valueFromDoc = Integer.parseInt(reader.document(hit.doc).get("value"));
+      int valueFromDoc = Integer.parseInt(reader.document(hit.doc).getString("value"));
       assertEquals(++i, valueFromDoc);
     }
 
@@ -94,7 +94,7 @@ public class TestFunctionQuerySort exten
     // Verify that hits are actually "after"
     int afterValue = ((Double) afterHit.fields[0]).intValue();
     for (ScoreDoc hit : hits.scoreDocs) {
-      int val = Integer.parseInt(reader.document(hit.doc).get("value"));
+      int val = Integer.parseInt(reader.document(hit.doc).getString("value"));
       assertTrue(afterValue <= val);
       assertFalse(hit.doc == afterHit.doc);
     }

Modified: lucene/dev/branches/lucene6005/lucene/queryparser/src/test/org/apache/lucene/queryparser/complexPhrase/TestComplexPhraseQuery.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene6005/lucene/queryparser/src/test/org/apache/lucene/queryparser/complexPhrase/TestComplexPhraseQuery.java?rev=1635898&r1=1635897&r2=1635898&view=diff
==============================================================================
--- lucene/dev/branches/lucene6005/lucene/queryparser/src/test/org/apache/lucene/queryparser/complexPhrase/TestComplexPhraseQuery.java (original)
+++ lucene/dev/branches/lucene6005/lucene/queryparser/src/test/org/apache/lucene/queryparser/complexPhrase/TestComplexPhraseQuery.java Sat Nov  1 08:39:27 2014
@@ -21,12 +21,12 @@ import java.util.HashSet;
 
 import org.apache.lucene.analysis.Analyzer;
 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;
 import org.apache.lucene.index.IndexReader;
 import org.apache.lucene.index.IndexWriter;
-import org.apache.lucene.index.StoredDocument;
 import org.apache.lucene.search.IndexSearcher;
 import org.apache.lucene.search.Query;
 import org.apache.lucene.search.ScoreDoc;
@@ -116,8 +116,8 @@ public class TestComplexPhraseQuery exte
     TopDocs td = searcher.search(q, 10);
     ScoreDoc[] sd = td.scoreDocs;
     for (int i = 0; i < sd.length; i++) {
-      StoredDocument doc = searcher.doc(sd[i].doc);
-      String id = doc.get("id");
+      Document2 doc = searcher.doc(sd[i].doc);
+      String id = doc.getString("id");
       assertTrue(qString + "matched doc#" + id + " not expected", expecteds
           .contains(id));
       expecteds.remove(id);

Modified: lucene/dev/branches/lucene6005/lucene/queryparser/src/test/org/apache/lucene/queryparser/xml/TestParser.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene6005/lucene/queryparser/src/test/org/apache/lucene/queryparser/xml/TestParser.java?rev=1635898&r1=1635897&r2=1635898&view=diff
==============================================================================
--- lucene/dev/branches/lucene6005/lucene/queryparser/src/test/org/apache/lucene/queryparser/xml/TestParser.java (original)
+++ lucene/dev/branches/lucene6005/lucene/queryparser/src/test/org/apache/lucene/queryparser/xml/TestParser.java Sat Nov  1 08:39:27 2014
@@ -17,18 +17,25 @@ package org.apache.lucene.queryparser.xm
  * limitations under the License.
  */
 
+import java.io.BufferedReader;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.InputStreamReader;
+import java.nio.charset.StandardCharsets;
+import java.util.List;
+
 import org.apache.lucene.analysis.Analyzer;
 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.document.IntField;
-import org.apache.lucene.index.LeafReaderContext;
 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.LeafReaderContext;
 import org.apache.lucene.search.DisjunctionMaxQuery;
 import org.apache.lucene.search.IndexSearcher;
 import org.apache.lucene.search.Query;
@@ -40,13 +47,6 @@ import org.junit.AfterClass;
 import org.junit.Assume;
 import org.junit.BeforeClass;
 
-import java.io.BufferedReader;
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.InputStreamReader;
-import java.nio.charset.StandardCharsets;
-import java.util.List;
-
 
 public class TestParser extends LuceneTestCase {
 
@@ -233,8 +233,8 @@ public class TestParser extends LuceneTe
       System.out.println("=========" + qType + "============");
       ScoreDoc[] scoreDocs = hits.scoreDocs;
       for (int i = 0; i < Math.min(numDocs, hits.totalHits); i++) {
-        StoredDocument ldoc = searcher.doc(scoreDocs[i].doc);
-        System.out.println("[" + ldoc.get("date") + "]" + ldoc.get("contents"));
+        Document2 ldoc = searcher.doc(scoreDocs[i].doc);
+        System.out.println("[" + ldoc.getString("date") + "]" + ldoc.getString("contents"));
       }
       System.out.println();
     }

Modified: lucene/dev/branches/lucene6005/lucene/sandbox/src/test/org/apache/lucene/sandbox/queries/DuplicateFilterTest.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene6005/lucene/sandbox/src/test/org/apache/lucene/sandbox/queries/DuplicateFilterTest.java?rev=1635898&r1=1635897&r2=1635898&view=diff
==============================================================================
--- lucene/dev/branches/lucene6005/lucene/sandbox/src/test/org/apache/lucene/sandbox/queries/DuplicateFilterTest.java (original)
+++ lucene/dev/branches/lucene6005/lucene/sandbox/src/test/org/apache/lucene/sandbox/queries/DuplicateFilterTest.java Sat Nov  1 08:39:27 2014
@@ -21,6 +21,7 @@ import java.io.IOException;
 import java.util.HashSet;
 
 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.*;
@@ -87,8 +88,8 @@ public class DuplicateFilterTest extends
     ScoreDoc[] hits = searcher.search(tq, df, 1000).scoreDocs;
 
     for (ScoreDoc hit : hits) {
-      StoredDocument d = searcher.doc(hit.doc);
-      String url = d.get(KEY_FIELD);
+      Document2 d = searcher.doc(hit.doc);
+      String url = d.getString(KEY_FIELD);
       assertFalse("No duplicate urls should be returned", results.contains(url));
       results.add(url);
     }
@@ -101,8 +102,8 @@ public class DuplicateFilterTest extends
     boolean dupsFound = false;
 
     for (ScoreDoc hit : hits) {
-      StoredDocument d = searcher.doc(hit.doc);
-      String url = d.get(KEY_FIELD);
+      Document2 d = searcher.doc(hit.doc);
+      String url = d.getString(KEY_FIELD);
       if (!dupsFound)
         dupsFound = results.contains(url);
       results.add(url);
@@ -118,8 +119,8 @@ public class DuplicateFilterTest extends
     assertTrue("Filtered searching should have found some matches", hits.length > 0);
 
     for (ScoreDoc hit : hits) {
-      StoredDocument d = searcher.doc(hit.doc);
-      String url = d.get(KEY_FIELD);
+      Document2 d = searcher.doc(hit.doc);
+      String url = d.getString(KEY_FIELD);
       assertFalse("No duplicate urls should be returned", results.contains(url));
       results.add(url);
     }
@@ -132,8 +133,8 @@ public class DuplicateFilterTest extends
     ScoreDoc[] hits = searcher.search(tq, df, 1000).scoreDocs;
     assertTrue("Filtered searching should have found some matches", hits.length > 0);
     for (ScoreDoc hit : hits) {
-      StoredDocument d = searcher.doc(hit.doc);
-      String url = d.get(KEY_FIELD);
+      Document2 d = searcher.doc(hit.doc);
+      String url = d.getString(KEY_FIELD);
       DocsEnum td = TestUtil.docs(random(), reader,
           KEY_FIELD,
           new BytesRef(url),
@@ -156,8 +157,8 @@ public class DuplicateFilterTest extends
     ScoreDoc[] hits = searcher.search(tq, df, 1000).scoreDocs;
     assertTrue("Filtered searching should have found some matches", hits.length > 0);
     for (ScoreDoc hit : hits) {
-      StoredDocument d = searcher.doc(hit.doc);
-      String url = d.get(KEY_FIELD);
+      Document2 d = searcher.doc(hit.doc);
+      String url = d.getString(KEY_FIELD);
       DocsEnum td = TestUtil.docs(random(), reader,
           KEY_FIELD,
           new BytesRef(url),

Modified: lucene/dev/branches/lucene6005/lucene/sandbox/src/test/org/apache/lucene/sandbox/queries/FuzzyLikeThisQueryTest.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene6005/lucene/sandbox/src/test/org/apache/lucene/sandbox/queries/FuzzyLikeThisQueryTest.java?rev=1635898&r1=1635897&r2=1635898&view=diff
==============================================================================
--- lucene/dev/branches/lucene6005/lucene/sandbox/src/test/org/apache/lucene/sandbox/queries/FuzzyLikeThisQueryTest.java (original)
+++ lucene/dev/branches/lucene6005/lucene/sandbox/src/test/org/apache/lucene/sandbox/queries/FuzzyLikeThisQueryTest.java Sat Nov  1 08:39:27 2014
@@ -17,13 +17,16 @@ package org.apache.lucene.sandbox.querie
  * limitations under the License.
  */
 
+import java.io.IOException;
+import java.util.HashSet;
+
 import org.apache.lucene.analysis.Analyzer;
 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.IndexReader;
 import org.apache.lucene.index.RandomIndexWriter;
-import org.apache.lucene.index.StoredDocument;
 import org.apache.lucene.index.Term;
 import org.apache.lucene.search.IndexSearcher;
 import org.apache.lucene.search.Query;
@@ -32,9 +35,6 @@ import org.apache.lucene.search.TopDocs;
 import org.apache.lucene.store.Directory;
 import org.apache.lucene.util.LuceneTestCase;
 
-import java.io.IOException;
-import java.util.HashSet;
-
 public class FuzzyLikeThisQueryTest extends LuceneTestCase {
   private Directory directory;
   private IndexSearcher searcher;
@@ -89,8 +89,8 @@ public class FuzzyLikeThisQueryTest exte
     TopDocs topDocs = searcher.search(flt, 1);
     ScoreDoc[] sd = topDocs.scoreDocs;
     assertTrue("score docs must match 1 doc", (sd != null) && (sd.length > 0));
-    StoredDocument doc = searcher.doc(sd[0].doc);
-    assertEquals("Should match most similar not most rare variant", "2", doc.get("id"));
+    Document2 doc = searcher.doc(sd[0].doc);
+    assertEquals("Should match most similar not most rare variant", "2", doc.getString("id"));
   }
 
   //Test multiple input words are having variants produced
@@ -105,8 +105,8 @@ public class FuzzyLikeThisQueryTest exte
     TopDocs topDocs = searcher.search(flt, 1);
     ScoreDoc[] sd = topDocs.scoreDocs;
     assertTrue("score docs must match 1 doc", (sd != null) && (sd.length > 0));
-    StoredDocument doc = searcher.doc(sd[0].doc);
-    assertEquals("Should match most similar when using 2 words", "2", doc.get("id"));
+    Document2 doc = searcher.doc(sd[0].doc);
+    assertEquals("Should match most similar when using 2 words", "2", doc.getString("id"));
   }
   
   // LUCENE-4809
@@ -123,8 +123,8 @@ public class FuzzyLikeThisQueryTest exte
     TopDocs topDocs = searcher.search(flt, 1);
     ScoreDoc[] sd = topDocs.scoreDocs;
     assertTrue("score docs must match 1 doc", (sd != null) && (sd.length > 0));
-    StoredDocument doc = searcher.doc(sd[0].doc);
-    assertEquals("Should match most similar when using 2 words", "2", doc.get("id"));
+    Document2 doc = searcher.doc(sd[0].doc);
+    assertEquals("Should match most similar when using 2 words", "2", doc.getString("id"));
   }
 
 
@@ -139,8 +139,8 @@ public class FuzzyLikeThisQueryTest exte
     TopDocs topDocs = searcher.search(flt, 1);
     ScoreDoc[] sd = topDocs.scoreDocs;
     assertTrue("score docs must match 1 doc", (sd != null) && (sd.length > 0));
-    StoredDocument doc = searcher.doc(sd[0].doc);
-    assertEquals("Should match most similar when using 2 words", "2", doc.get("id"));
+    Document2 doc = searcher.doc(sd[0].doc);
+    assertEquals("Should match most similar when using 2 words", "2", doc.getString("id"));
   }
 
   public void testFuzzyLikeThisQueryEquals() {

Modified: lucene/dev/branches/lucene6005/lucene/sandbox/src/test/org/apache/lucene/sandbox/queries/TestSlowCollationMethods.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene6005/lucene/sandbox/src/test/org/apache/lucene/sandbox/queries/TestSlowCollationMethods.java?rev=1635898&r1=1635897&r2=1635898&view=diff
==============================================================================
--- lucene/dev/branches/lucene6005/lucene/sandbox/src/test/org/apache/lucene/sandbox/queries/TestSlowCollationMethods.java (original)
+++ lucene/dev/branches/lucene6005/lucene/sandbox/src/test/org/apache/lucene/sandbox/queries/TestSlowCollationMethods.java Sat Nov  1 08:39:27 2014
@@ -84,7 +84,7 @@ public class TestSlowCollationMethods ex
   private void doCheckSorting(TopDocs docs) throws Exception {
     String prev = "";
     for (ScoreDoc doc : docs.scoreDocs) {
-      String value = reader.document(doc.doc).get("field");
+      String value = reader.document(doc.doc).getString("field");
       assertTrue(collator.compare(value, prev) >= 0);
       prev = value;
     }
@@ -115,7 +115,7 @@ public class TestSlowCollationMethods ex
     // positive test
     TopDocs docs = searcher.search(query, numDocs);
     for (ScoreDoc doc : docs.scoreDocs) {
-      String value = reader.document(doc.doc).get("field");
+      String value = reader.document(doc.doc).getString("field");
       assertTrue(collator.compare(value, startPoint) >= 0);
       assertTrue(collator.compare(value, endPoint) <= 0);
     }
@@ -126,7 +126,7 @@ public class TestSlowCollationMethods ex
     bq.add(query, Occur.MUST_NOT);
     docs = searcher.search(bq, numDocs);
     for (ScoreDoc doc : docs.scoreDocs) {
-      String value = reader.document(doc.doc).get("field");
+      String value = reader.document(doc.doc).getString("field");
       assertTrue(collator.compare(value, startPoint) < 0 || collator.compare(value, endPoint) > 0);
     }
   }

Modified: lucene/dev/branches/lucene6005/lucene/sandbox/src/test/org/apache/lucene/sandbox/queries/TestSlowFuzzyQuery.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene6005/lucene/sandbox/src/test/org/apache/lucene/sandbox/queries/TestSlowFuzzyQuery.java?rev=1635898&r1=1635897&r2=1635898&view=diff
==============================================================================
--- lucene/dev/branches/lucene6005/lucene/sandbox/src/test/org/apache/lucene/sandbox/queries/TestSlowFuzzyQuery.java (original)
+++ lucene/dev/branches/lucene6005/lucene/sandbox/src/test/org/apache/lucene/sandbox/queries/TestSlowFuzzyQuery.java Sat Nov  1 08:39:27 2014
@@ -89,7 +89,7 @@ public class TestSlowFuzzyQuery extends 
     assertEquals("3 documents should match", 3, hits.length);
     List<String> order = Arrays.asList("bbbbb","abbbb","aabbb");
     for (int i = 0; i < hits.length; i++) {
-      final String term = searcher.doc(hits[i].doc).get("field");
+      final String term = searcher.doc(hits[i].doc).getString("field");
       //System.out.println(hits[i].score);
       assertEquals(order.get(i), term);
     }
@@ -101,7 +101,7 @@ public class TestSlowFuzzyQuery extends 
     assertEquals("only 2 documents should match", 2, hits.length);
     order = Arrays.asList("bbbbb","abbbb");
     for (int i = 0; i < hits.length; i++) {
-      final String term = searcher.doc(hits[i].doc).get("field");
+      final String term = searcher.doc(hits[i].doc).getString("field");
       //System.out.println(hits[i].score);
       assertEquals(order.get(i), term);
     }

Modified: lucene/dev/branches/lucene6005/lucene/sandbox/src/test/org/apache/lucene/search/TestTermAutomatonQuery.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene6005/lucene/sandbox/src/test/org/apache/lucene/search/TestTermAutomatonQuery.java?rev=1635898&r1=1635897&r2=1635898&view=diff
==============================================================================
--- lucene/dev/branches/lucene6005/lucene/sandbox/src/test/org/apache/lucene/search/TestTermAutomatonQuery.java (original)
+++ lucene/dev/branches/lucene6005/lucene/sandbox/src/test/org/apache/lucene/search/TestTermAutomatonQuery.java Sat Nov  1 08:39:27 2014
@@ -611,7 +611,7 @@ public class TestTermAutomatonQuery exte
   private Set<String> toDocIDs(IndexSearcher s, TopDocs hits) throws IOException {
     Set<String> result = new HashSet<>();
     for(ScoreDoc hit : hits.scoreDocs) {
-      result.add(s.doc(hit.doc).get("id"));
+      result.add(s.doc(hit.doc).getString("id"));
     }
     return result;
   }

Modified: lucene/dev/branches/lucene6005/lucene/spatial/src/test/org/apache/lucene/spatial/PortedSolr3Test.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene6005/lucene/spatial/src/test/org/apache/lucene/spatial/PortedSolr3Test.java?rev=1635898&r1=1635897&r2=1635898&view=diff
==============================================================================
--- lucene/dev/branches/lucene6005/lucene/spatial/src/test/org/apache/lucene/spatial/PortedSolr3Test.java (original)
+++ lucene/dev/branches/lucene6005/lucene/spatial/src/test/org/apache/lucene/spatial/PortedSolr3Test.java Sat Nov  1 08:39:27 2014
@@ -178,7 +178,7 @@ public class PortedSolr3Test extends Str
     if (assertIds != null) {
       Set<Integer> resultIds = new HashSet<>();
       for (SearchResult result : results.results) {
-        resultIds.add(Integer.valueOf(result.document.get("id")));
+        resultIds.add(Integer.valueOf(result.document.getString("id")));
       }
       for (int assertId : assertIds) {
         assertTrue("has " + assertId, resultIds.contains(assertId));

Modified: lucene/dev/branches/lucene6005/lucene/spatial/src/test/org/apache/lucene/spatial/SpatialExample.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene6005/lucene/spatial/src/test/org/apache/lucene/spatial/SpatialExample.java?rev=1635898&r1=1635897&r2=1635898&view=diff
==============================================================================
--- lucene/dev/branches/lucene6005/lucene/spatial/src/test/org/apache/lucene/spatial/SpatialExample.java (original)
+++ lucene/dev/branches/lucene6005/lucene/spatial/src/test/org/apache/lucene/spatial/SpatialExample.java Sat Nov  1 08:39:27 2014
@@ -17,10 +17,9 @@ package org.apache.lucene.spatial;
  * limitations under the License.
  */
 
-import com.spatial4j.core.context.SpatialContext;
-import com.spatial4j.core.distance.DistanceUtils;
-import com.spatial4j.core.shape.Point;
-import com.spatial4j.core.shape.Shape;
+import java.io.IOException;
+
+import org.apache.lucene.document.Document2;
 import org.apache.lucene.document.Document;
 import org.apache.lucene.document.Field;
 import org.apache.lucene.document.IntField;
@@ -29,7 +28,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.queries.function.ValueSource;
 import org.apache.lucene.search.Filter;
 import org.apache.lucene.search.IndexSearcher;
@@ -46,8 +44,10 @@ import org.apache.lucene.spatial.query.S
 import org.apache.lucene.store.Directory;
 import org.apache.lucene.store.RAMDirectory;
 import org.apache.lucene.util.LuceneTestCase;
-
-import java.io.IOException;
+import com.spatial4j.core.context.SpatialContext;
+import com.spatial4j.core.distance.DistanceUtils;
+import com.spatial4j.core.shape.Point;
+import com.spatial4j.core.shape.Shape;
 
 /**
  * This class serves as example code to show how to use the Lucene spatial
@@ -154,7 +154,7 @@ public class SpatialExample extends Luce
       assertDocMatchedIds(indexSearcher, docs, 2);
       //Now, lets get the distance for the 1st doc via computing from stored point value:
       // (this computation is usually not redundant)
-      StoredDocument doc1 = indexSearcher.doc(docs.scoreDocs[0].doc);
+      Document2 doc1 = indexSearcher.doc(docs.scoreDocs[0].doc);
       String doc1Str = doc1.getField(strategy.getFieldName()).stringValue();
       //assume doc1Str is "x y" as written in newSampleDocument()
       int spaceIdx = doc1Str.indexOf(' ');

Modified: lucene/dev/branches/lucene6005/lucene/spatial/src/test/org/apache/lucene/spatial/SpatialTestCase.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene6005/lucene/spatial/src/test/org/apache/lucene/spatial/SpatialTestCase.java?rev=1635898&r1=1635897&r2=1635898&view=diff
==============================================================================
--- lucene/dev/branches/lucene6005/lucene/spatial/src/test/org/apache/lucene/spatial/SpatialTestCase.java (original)
+++ lucene/dev/branches/lucene6005/lucene/spatial/src/test/org/apache/lucene/spatial/SpatialTestCase.java Sat Nov  1 08:39:27 2014
@@ -17,35 +17,35 @@ package org.apache.lucene.spatial;
  * limitations under the License.
  */
 
-import com.spatial4j.core.context.SpatialContext;
-import com.spatial4j.core.shape.Point;
-import com.spatial4j.core.shape.Rectangle;
+import java.io.IOException;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.Random;
+
 import org.apache.lucene.analysis.MockAnalyzer;
+import org.apache.lucene.document.Document2;
 import org.apache.lucene.document.Document;
 import org.apache.lucene.index.DirectoryReader;
 import org.apache.lucene.index.IndexWriterConfig;
 import org.apache.lucene.index.RandomIndexWriter;
-import org.apache.lucene.index.StoredDocument;
 import org.apache.lucene.search.IndexSearcher;
 import org.apache.lucene.search.Query;
 import org.apache.lucene.search.ScoreDoc;
 import org.apache.lucene.search.TopDocs;
 import org.apache.lucene.store.Directory;
-import org.apache.lucene.uninverting.UninvertingReader;
 import org.apache.lucene.uninverting.UninvertingReader.Type;
+import org.apache.lucene.uninverting.UninvertingReader;
 import org.apache.lucene.util.IOUtils;
-import org.apache.lucene.util.LuceneTestCase;
 import org.apache.lucene.util.LuceneTestCase.SuppressSysoutChecks;
+import org.apache.lucene.util.LuceneTestCase;
 import org.apache.lucene.util.TestUtil;
 import org.junit.After;
 import org.junit.Before;
-
-import java.io.IOException;
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-import java.util.Random;
+import com.spatial4j.core.context.SpatialContext;
+import com.spatial4j.core.shape.Point;
+import com.spatial4j.core.shape.Rectangle;
 
 import static com.carrotsearch.randomizedtesting.RandomizedTest.randomGaussian;
 import static com.carrotsearch.randomizedtesting.RandomizedTest.randomIntBetween;
@@ -234,15 +234,15 @@ public abstract class SpatialTestCase ex
   protected static class SearchResult {
 
     public float score;
-    public StoredDocument document;
+    public Document2 document;
 
-    public SearchResult(float score, StoredDocument storedDocument) {
+    public SearchResult(float score, Document2 storedDocument) {
       this.score = score;
       this.document = storedDocument;
     }
 
     public String getId() {
-      return document.get("id");
+      return document.getString("id");
     }
     
     @Override

Modified: lucene/dev/branches/lucene6005/lucene/spatial/src/test/org/apache/lucene/spatial/StrategyTestCase.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene6005/lucene/spatial/src/test/org/apache/lucene/spatial/StrategyTestCase.java?rev=1635898&r1=1635897&r2=1635898&view=diff
==============================================================================
--- lucene/dev/branches/lucene6005/lucene/spatial/src/test/org/apache/lucene/spatial/StrategyTestCase.java (original)
+++ lucene/dev/branches/lucene6005/lucene/spatial/src/test/org/apache/lucene/spatial/StrategyTestCase.java Sat Nov  1 08:39:27 2014
@@ -147,7 +147,7 @@ public abstract class StrategyTestCase e
     if (concern.orderIsImportant) {
       Iterator<String> ids = q.ids.iterator();
       for (SearchResult r : got.results) {
-        String id = r.document.get("id");
+        String id = r.document.getString("id");
         if (!ids.hasNext()) {
           fail(msg + " :: Did not get enough results.  Expect" + q.ids + ", got: " + got.toDebugString());
         }
@@ -162,7 +162,7 @@ public abstract class StrategyTestCase e
       if (concern.resultsAreSuperset) {
         Set<String> found = new HashSet<>();
         for (SearchResult r : got.results) {
-          found.add(r.document.get("id"));
+          found.add(r.document.getString("id"));
         }
         for (String s : q.ids) {
           if (!found.contains(s)) {
@@ -172,7 +172,7 @@ public abstract class StrategyTestCase e
       } else {
         List<String> found = new ArrayList<>();
         for (SearchResult r : got.results) {
-          found.add(r.document.get("id"));
+          found.add(r.document.getString("id"));
         }
 
         // sort both so that the order is not important

Modified: lucene/dev/branches/lucene6005/lucene/spatial/src/test/org/apache/lucene/spatial/prefix/TestRecursivePrefixTreeStrategy.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene6005/lucene/spatial/src/test/org/apache/lucene/spatial/prefix/TestRecursivePrefixTreeStrategy.java?rev=1635898&r1=1635897&r2=1635898&view=diff
==============================================================================
--- lucene/dev/branches/lucene6005/lucene/spatial/src/test/org/apache/lucene/spatial/prefix/TestRecursivePrefixTreeStrategy.java (original)
+++ lucene/dev/branches/lucene6005/lucene/spatial/src/test/org/apache/lucene/spatial/prefix/TestRecursivePrefixTreeStrategy.java Sat Nov  1 08:39:27 2014
@@ -112,7 +112,7 @@ public class TestRecursivePrefixTreeStra
     if (assertIds != null) {
       Set<Integer> gotIds = new HashSet<>();
       for (SearchResult result : got.results) {
-        gotIds.add(Integer.valueOf(result.document.get("id")));
+        gotIds.add(Integer.valueOf(result.document.getString("id")));
       }
       for (int assertId : assertIds) {
         assertTrue("has "+assertId,gotIds.contains(assertId));

Modified: lucene/dev/branches/lucene6005/lucene/suggest/src/java/org/apache/lucene/search/spell/SpellChecker.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene6005/lucene/suggest/src/java/org/apache/lucene/search/spell/SpellChecker.java?rev=1635898&r1=1635897&r2=1635898&view=diff
==============================================================================
--- lucene/dev/branches/lucene6005/lucene/suggest/src/java/org/apache/lucene/search/spell/SpellChecker.java (original)
+++ lucene/dev/branches/lucene6005/lucene/suggest/src/java/org/apache/lucene/search/spell/SpellChecker.java Sat Nov  1 08:39:27 2014
@@ -373,7 +373,7 @@ public class SpellChecker implements jav
       SuggestWord sugWord = new SuggestWord();
       for (int i = 0; i < stop; i++) {
 
-        sugWord.string = indexSearcher.doc(hits[i].doc).get(F_WORD); // get orig word
+        sugWord.string = indexSearcher.doc(hits[i].doc).getString(F_WORD); // get orig word
 
         // don't suggest a word for itself, that would be silly
         if (sugWord.string.equals(word)) {

Modified: lucene/dev/branches/lucene6005/lucene/suggest/src/java/org/apache/lucene/search/suggest/DocumentDictionary.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene6005/lucene/suggest/src/java/org/apache/lucene/search/suggest/DocumentDictionary.java?rev=1635898&r1=1635897&r2=1635898&view=diff
==============================================================================
--- lucene/dev/branches/lucene6005/lucene/suggest/src/java/org/apache/lucene/search/suggest/DocumentDictionary.java (original)
+++ lucene/dev/branches/lucene6005/lucene/suggest/src/java/org/apache/lucene/search/suggest/DocumentDictionary.java Sat Nov  1 08:39:27 2014
@@ -20,12 +20,12 @@ import java.io.IOException;
 import java.util.HashSet;
 import java.util.Set;
 
+import org.apache.lucene.document.Document2;
 import org.apache.lucene.index.IndexReader;
+import org.apache.lucene.index.IndexableField;
 import org.apache.lucene.index.MultiDocValues;
 import org.apache.lucene.index.MultiFields;
 import org.apache.lucene.index.NumericDocValues;
-import org.apache.lucene.index.StorableField;
-import org.apache.lucene.index.StoredDocument;
 import org.apache.lucene.search.spell.Dictionary;
 import org.apache.lucene.util.Bits;
 import org.apache.lucene.util.BytesRef;
@@ -143,14 +143,14 @@ public class DocumentDictionary implemen
           continue;
         }
 
-        StoredDocument doc = reader.document(currentDocId, relevantFields);
+        Document2 doc = reader.document(currentDocId, relevantFields);
 
         BytesRef tempPayload = null;
         BytesRef tempTerm = null;
         Set<BytesRef> tempContexts = new HashSet<>();
 
         if (hasPayloads) {
-          StorableField payload = doc.getField(payloadField);
+          IndexableField payload = doc.getField(payloadField);
           if (payload == null || (payload.binaryValue() == null && payload.stringValue() == null)) {
             continue;
           }
@@ -158,8 +158,7 @@ public class DocumentDictionary implemen
         }
 
         if (hasContexts) {
-          final StorableField[] contextFields = doc.getFields(contextsField);
-          for (StorableField contextField : contextFields) {
+          for (IndexableField contextField : doc.getFields(contextsField)) {
             if (contextField.binaryValue() == null && contextField.stringValue() == null) {
               continue;
             } else {
@@ -168,7 +167,7 @@ public class DocumentDictionary implemen
           }
         }
 
-        StorableField fieldVal = doc.getField(field);
+        IndexableField fieldVal = doc.getField(field);
         if (fieldVal == null || (fieldVal.binaryValue() == null && fieldVal.stringValue() == null)) {
           continue;
         }
@@ -199,8 +198,8 @@ public class DocumentDictionary implemen
      * or if its indexed as {@link NumericDocValues} (using <code>docId</code>) for the document.
      * If no value is found, then the weight is 0.
      */
-    protected long getWeight(StoredDocument doc, int docId) {
-      StorableField weight = doc.getField(weightField);
+    protected long getWeight(Document2 doc, int docId) {
+      IndexableField weight = doc.getField(weightField);
       if (weight != null) { // found weight as stored
         return (weight.numericValue() != null) ? weight.numericValue().longValue() : 0;
       } else if (weightValues != null) {  // found weight as NumericDocValue

Modified: lucene/dev/branches/lucene6005/lucene/suggest/src/java/org/apache/lucene/search/suggest/DocumentValueSourceDictionary.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene6005/lucene/suggest/src/java/org/apache/lucene/search/suggest/DocumentValueSourceDictionary.java?rev=1635898&r1=1635897&r2=1635898&view=diff
==============================================================================
--- lucene/dev/branches/lucene6005/lucene/suggest/src/java/org/apache/lucene/search/suggest/DocumentValueSourceDictionary.java (original)
+++ lucene/dev/branches/lucene6005/lucene/suggest/src/java/org/apache/lucene/search/suggest/DocumentValueSourceDictionary.java Sat Nov  1 08:39:27 2014
@@ -21,10 +21,10 @@ import java.io.IOException;
 import java.util.HashMap;
 import java.util.List;
 
-import org.apache.lucene.index.LeafReaderContext;
+import org.apache.lucene.document.Document2;
 import org.apache.lucene.index.IndexReader;
+import org.apache.lucene.index.LeafReaderContext;
 import org.apache.lucene.index.ReaderUtil;
-import org.apache.lucene.index.StoredDocument;
 import org.apache.lucene.queries.function.FunctionValues;
 import org.apache.lucene.queries.function.ValueSource;
 
@@ -135,7 +135,7 @@ public class DocumentValueSourceDictiona
      * by the <code>weightsValueSource</code>
      * */
     @Override
-    protected long getWeight(StoredDocument doc, int docId) {    
+    protected long getWeight(Document2 doc, int docId) {    
       if (currentWeightValues == null) {
         return 0;
       }

Modified: lucene/dev/branches/lucene6005/lucene/suggest/src/test/org/apache/lucene/search/suggest/DocumentDictionaryTest.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene6005/lucene/suggest/src/test/org/apache/lucene/search/suggest/DocumentDictionaryTest.java?rev=1635898&r1=1635897&r2=1635898&view=diff
==============================================================================
--- lucene/dev/branches/lucene6005/lucene/suggest/src/test/org/apache/lucene/search/suggest/DocumentDictionaryTest.java (original)
+++ lucene/dev/branches/lucene6005/lucene/suggest/src/test/org/apache/lucene/search/suggest/DocumentDictionaryTest.java Sat Nov  1 08:39:27 2014
@@ -19,8 +19,8 @@ import org.apache.lucene.document.TextFi
 import org.apache.lucene.index.DirectoryReader;
 import org.apache.lucene.index.IndexReader;
 import org.apache.lucene.index.IndexWriterConfig;
+import org.apache.lucene.index.IndexableField;
 import org.apache.lucene.index.RandomIndexWriter;
-import org.apache.lucene.index.StorableField;
 import org.apache.lucene.index.Term;
 import org.apache.lucene.search.spell.Dictionary;
 import org.apache.lucene.store.Directory;
@@ -151,7 +151,7 @@ public class DocumentDictionaryTest exte
     while((f = inputIterator.next())!=null) {
       Document doc = docs.remove(f.utf8ToString());
       assertTrue(f.equals(new BytesRef(doc.get(FIELD_NAME))));
-      Field weightField = doc.getField(WEIGHT_FIELD_NAME);
+      IndexableField weightField = doc.getField(WEIGHT_FIELD_NAME);
       assertEquals(inputIterator.weight(), (weightField != null) ? weightField.numericValue().longValue() : 0);
       assertTrue(inputIterator.payload().equals(doc.getField(PAYLOAD_FIELD_NAME).binaryValue()));
     }
@@ -186,7 +186,7 @@ public class DocumentDictionaryTest exte
     while((f = inputIterator.next())!=null) {
       Document doc = docs.remove(f.utf8ToString());
       assertTrue(f.equals(new BytesRef(doc.get(FIELD_NAME))));
-      Field weightField = doc.getField(WEIGHT_FIELD_NAME);
+      IndexableField weightField = doc.getField(WEIGHT_FIELD_NAME);
       assertEquals(inputIterator.weight(), (weightField != null) ? weightField.numericValue().longValue() : 0);
       assertEquals(inputIterator.payload(), null);
     }
@@ -222,12 +222,12 @@ public class DocumentDictionaryTest exte
     while((f = inputIterator.next())!=null) {
       Document doc = docs.remove(f.utf8ToString());
       assertTrue(f.equals(new BytesRef(doc.get(FIELD_NAME))));
-      Field weightField = doc.getField(WEIGHT_FIELD_NAME);
+      IndexableField weightField = doc.getField(WEIGHT_FIELD_NAME);
       assertEquals(inputIterator.weight(), (weightField != null) ? weightField.numericValue().longValue() : 0);
       assertTrue(inputIterator.payload().equals(doc.getField(PAYLOAD_FIELD_NAME).binaryValue()));
       Set<BytesRef> oriCtxs = new HashSet<>();
       Set<BytesRef> contextSet = inputIterator.contexts();
-      for (StorableField ctxf : doc.getFields(CONTEXT_FIELD_NAME)) {
+      for (IndexableField ctxf : doc.getFields(CONTEXT_FIELD_NAME)) {
         oriCtxs.add(ctxf.binaryValue());
       }
       assertEquals(oriCtxs.size(), contextSet.size());
@@ -254,7 +254,7 @@ public class DocumentDictionaryTest exte
     Random rand = random();
     List<String> termsToDel = new ArrayList<>();
     for(Document doc : docs.values()) {
-      StorableField f = doc.getField(FIELD_NAME);
+      IndexableField f = doc.getField(FIELD_NAME);
       if(rand.nextBoolean() && f != null && !invalidDocTerms.contains(f.stringValue())) {
         termsToDel.add(doc.get(FIELD_NAME));
       }
@@ -285,7 +285,7 @@ public class DocumentDictionaryTest exte
     while((f = inputIterator.next())!=null) {
       Document doc = docs.remove(f.utf8ToString());
       assertTrue(f.equals(new BytesRef(doc.get(FIELD_NAME))));
-      Field weightField = doc.getField(WEIGHT_FIELD_NAME);
+      IndexableField weightField = doc.getField(WEIGHT_FIELD_NAME);
       assertEquals(inputIterator.weight(), (weightField != null) ? weightField.numericValue().longValue() : 0);
       assertEquals(inputIterator.payload(), null);
     }

Modified: lucene/dev/branches/lucene6005/lucene/suggest/src/test/org/apache/lucene/search/suggest/DocumentValueSourceDictionaryTest.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene6005/lucene/suggest/src/test/org/apache/lucene/search/suggest/DocumentValueSourceDictionaryTest.java?rev=1635898&r1=1635897&r2=1635898&view=diff
==============================================================================
--- lucene/dev/branches/lucene6005/lucene/suggest/src/test/org/apache/lucene/search/suggest/DocumentValueSourceDictionaryTest.java (original)
+++ lucene/dev/branches/lucene6005/lucene/suggest/src/test/org/apache/lucene/search/suggest/DocumentValueSourceDictionaryTest.java Sat Nov  1 08:39:27 2014
@@ -35,6 +35,7 @@ import org.apache.lucene.document.TextFi
 import org.apache.lucene.index.DirectoryReader;
 import org.apache.lucene.index.IndexReader;
 import org.apache.lucene.index.IndexWriterConfig;
+import org.apache.lucene.index.IndexableField;
 import org.apache.lucene.index.RandomIndexWriter;
 import org.apache.lucene.index.Term;
 import org.apache.lucene.queries.function.ValueSource;
@@ -161,7 +162,7 @@ public class DocumentValueSourceDictiona
       assertEquals(inputIterator.weight(), (w1 + w2 + w3));
       assertTrue(inputIterator.payload().equals(doc.getField(PAYLOAD_FIELD_NAME).binaryValue()));
       Set<BytesRef> originalCtxs = new HashSet<>();
-      for (Field ctxf: doc.getFields(CONTEXTS_FIELD_NAME)) {
+      for (IndexableField ctxf: doc.getFields(CONTEXTS_FIELD_NAME)) {
         originalCtxs.add(ctxf.binaryValue());
       }
       assertEquals(originalCtxs, inputIterator.contexts());

Modified: lucene/dev/branches/lucene6005/lucene/test-framework/src/java/org/apache/lucene/analysis/CollationTestBase.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene6005/lucene/test-framework/src/java/org/apache/lucene/analysis/CollationTestBase.java?rev=1635898&r1=1635897&r2=1635898&view=diff
==============================================================================
--- lucene/dev/branches/lucene6005/lucene/test-framework/src/java/org/apache/lucene/analysis/CollationTestBase.java (original)
+++ lucene/dev/branches/lucene6005/lucene/test-framework/src/java/org/apache/lucene/analysis/CollationTestBase.java Sat Nov  1 08:39:27 2014
@@ -23,6 +23,7 @@ import java.util.HashMap;
 import java.util.Map;
 
 import org.apache.lucene.analysis.tokenattributes.TermToBytesRefAttribute;
+import org.apache.lucene.document.Document2;
 import org.apache.lucene.document.Document;
 import org.apache.lucene.document.Field;
 import org.apache.lucene.document.StringField;
@@ -31,8 +32,7 @@ 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.StorableField;
-import org.apache.lucene.index.StoredDocument;
+import org.apache.lucene.index.IndexableField;
 import org.apache.lucene.index.Term;
 import org.apache.lucene.search.IndexSearcher;
 import org.apache.lucene.search.Query;
@@ -156,10 +156,9 @@ public abstract class CollationTestBase 
     StringBuilder buff = new StringBuilder(10);
     int n = result.length;
     for (int i = 0 ; i < n ; ++i) {
-      StoredDocument doc = searcher.doc(result[i].doc);
-      StorableField[] v = doc.getFields("tracer");
-      for (int j = 0 ; j < v.length ; ++j) {
-        buff.append(v[j].stringValue());
+      Document2 doc = searcher.doc(result[i].doc);
+      for (IndexableField f : doc.getFields("tracer")) {
+        buff.append(f.stringValue());
       }
     }
     assertEquals(expectedResult, buff.toString());

Modified: lucene/dev/branches/lucene6005/lucene/test-framework/src/java/org/apache/lucene/codecs/asserting/AssertingStoredFieldsFormat.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene6005/lucene/test-framework/src/java/org/apache/lucene/codecs/asserting/AssertingStoredFieldsFormat.java?rev=1635898&r1=1635897&r2=1635898&view=diff
==============================================================================
--- lucene/dev/branches/lucene6005/lucene/test-framework/src/java/org/apache/lucene/codecs/asserting/AssertingStoredFieldsFormat.java (original)
+++ lucene/dev/branches/lucene6005/lucene/test-framework/src/java/org/apache/lucene/codecs/asserting/AssertingStoredFieldsFormat.java Sat Nov  1 08:39:27 2014
@@ -24,8 +24,8 @@ import org.apache.lucene.codecs.StoredFi
 import org.apache.lucene.codecs.StoredFieldsWriter;
 import org.apache.lucene.index.FieldInfo;
 import org.apache.lucene.index.FieldInfos;
+import org.apache.lucene.index.IndexableField;
 import org.apache.lucene.index.SegmentInfo;
-import org.apache.lucene.index.StorableField;
 import org.apache.lucene.index.StoredFieldVisitor;
 import org.apache.lucene.store.Directory;
 import org.apache.lucene.store.IOContext;
@@ -137,7 +137,7 @@ public class AssertingStoredFieldsFormat
     }
 
     @Override
-    public void writeField(FieldInfo info, StorableField field) throws IOException {
+    public void writeField(FieldInfo info, IndexableField field) throws IOException {
       assert docStatus == Status.STARTED;
       in.writeField(info, field);
     }

Modified: lucene/dev/branches/lucene6005/lucene/test-framework/src/java/org/apache/lucene/codecs/cranky/CrankyStoredFieldsFormat.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene6005/lucene/test-framework/src/java/org/apache/lucene/codecs/cranky/CrankyStoredFieldsFormat.java?rev=1635898&r1=1635897&r2=1635898&view=diff
==============================================================================
--- lucene/dev/branches/lucene6005/lucene/test-framework/src/java/org/apache/lucene/codecs/cranky/CrankyStoredFieldsFormat.java (original)
+++ lucene/dev/branches/lucene6005/lucene/test-framework/src/java/org/apache/lucene/codecs/cranky/CrankyStoredFieldsFormat.java Sat Nov  1 08:39:27 2014
@@ -25,9 +25,9 @@ import org.apache.lucene.codecs.StoredFi
 import org.apache.lucene.codecs.StoredFieldsWriter;
 import org.apache.lucene.index.FieldInfo;
 import org.apache.lucene.index.FieldInfos;
+import org.apache.lucene.index.IndexableField;
 import org.apache.lucene.index.MergeState;
 import org.apache.lucene.index.SegmentInfo;
-import org.apache.lucene.index.StorableField;
 import org.apache.lucene.store.Directory;
 import org.apache.lucene.store.IOContext;
 
@@ -114,7 +114,7 @@ class CrankyStoredFieldsFormat extends S
     }
 
     @Override
-    public void writeField(FieldInfo info, StorableField field) throws IOException {
+    public void writeField(FieldInfo info, IndexableField field) throws IOException {
       if (random.nextInt(10000) == 0) {
         throw new IOException("Fake IOException from StoredFieldsWriter.writeField()");
       }

Modified: lucene/dev/branches/lucene6005/lucene/test-framework/src/java/org/apache/lucene/index/BaseDocValuesFormatTestCase.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene6005/lucene/test-framework/src/java/org/apache/lucene/index/BaseDocValuesFormatTestCase.java?rev=1635898&r1=1635897&r2=1635898&view=diff
==============================================================================
--- lucene/dev/branches/lucene6005/lucene/test-framework/src/java/org/apache/lucene/index/BaseDocValuesFormatTestCase.java (original)
+++ lucene/dev/branches/lucene6005/lucene/test-framework/src/java/org/apache/lucene/index/BaseDocValuesFormatTestCase.java Sat Nov  1 08:39:27 2014
@@ -17,8 +17,6 @@ package org.apache.lucene.index;
  * limitations under the License.
  */
 
-import static org.apache.lucene.index.SortedSetDocValues.NO_MORE_ORDS;
-
 import java.io.ByteArrayOutputStream;
 import java.io.IOException;
 import java.io.PrintStream;
@@ -26,8 +24,8 @@ import java.util.ArrayList;
 import java.util.Arrays;
 import java.util.Collections;
 import java.util.HashMap;
-import java.util.Map;
 import java.util.Map.Entry;
+import java.util.Map;
 import java.util.Set;
 import java.util.TreeSet;
 import java.util.concurrent.CountDownLatch;
@@ -36,6 +34,7 @@ import org.apache.lucene.analysis.Analyz
 import org.apache.lucene.analysis.MockAnalyzer;
 import org.apache.lucene.codecs.Codec;
 import org.apache.lucene.document.BinaryDocValuesField;
+import org.apache.lucene.document.Document2;
 import org.apache.lucene.document.Document;
 import org.apache.lucene.document.Field;
 import org.apache.lucene.document.FloatDocValuesField;
@@ -61,6 +60,8 @@ import org.apache.lucene.util.BytesRefHa
 import org.apache.lucene.util.IOUtils;
 import org.apache.lucene.util.TestUtil;
 
+import static org.apache.lucene.index.SortedSetDocValues.NO_MORE_ORDS;
+
 /**
  * Abstract class to do basic tests for a docvalues format.
  * NOTE: This test focuses on the docvalues impl, nothing else.
@@ -113,8 +114,8 @@ public abstract class BaseDocValuesForma
     assertEquals(1, hits.totalHits);
     // Iterate through the results:
     for (int i = 0; i < hits.scoreDocs.length; i++) {
-      StoredDocument hitDoc = isearcher.doc(hits.scoreDocs[i].doc);
-      assertEquals(text, hitDoc.get("fieldname"));
+      Document2 hitDoc = isearcher.doc(hits.scoreDocs[i].doc);
+      assertEquals(text, hitDoc.getString("fieldname"));
       assert ireader.leaves().size() == 1;
       NumericDocValues dv = ireader.leaves().get(0).reader().getNumericDocValues("dv");
       assertEquals(5, dv.get(hits.scoreDocs[i].doc));
@@ -145,8 +146,8 @@ public abstract class BaseDocValuesForma
     assertEquals(1, hits.totalHits);
     // Iterate through the results:
     for (int i = 0; i < hits.scoreDocs.length; i++) {
-      StoredDocument hitDoc = isearcher.doc(hits.scoreDocs[i].doc);
-      assertEquals(text, hitDoc.get("fieldname"));
+      Document2 hitDoc = isearcher.doc(hits.scoreDocs[i].doc);
+      assertEquals(text, hitDoc.getString("fieldname"));
       assert ireader.leaves().size() == 1;
       NumericDocValues dv = ireader.leaves().get(0).reader().getNumericDocValues("dv");
       assertEquals(Float.floatToRawIntBits(5.7f), dv.get(hits.scoreDocs[i].doc));
@@ -178,8 +179,8 @@ public abstract class BaseDocValuesForma
     assertEquals(1, hits.totalHits);
     // Iterate through the results:
     for (int i = 0; i < hits.scoreDocs.length; i++) {
-      StoredDocument hitDoc = isearcher.doc(hits.scoreDocs[i].doc);
-      assertEquals(text, hitDoc.get("fieldname"));
+      Document2 hitDoc = isearcher.doc(hits.scoreDocs[i].doc);
+      assertEquals(text, hitDoc.getString("fieldname"));
       assert ireader.leaves().size() == 1;
       NumericDocValues dv = ireader.leaves().get(0).reader().getNumericDocValues("dv1");
       assertEquals(5, dv.get(hits.scoreDocs[i].doc));
@@ -213,8 +214,8 @@ public abstract class BaseDocValuesForma
     assertEquals(1, hits.totalHits);
     // Iterate through the results:
     for (int i = 0; i < hits.scoreDocs.length; i++) {
-      StoredDocument hitDoc = isearcher.doc(hits.scoreDocs[i].doc);
-      assertEquals(text, hitDoc.get("fieldname"));
+      Document2 hitDoc = isearcher.doc(hits.scoreDocs[i].doc);
+      assertEquals(text, hitDoc.getString("fieldname"));
       assert ireader.leaves().size() == 1;
       BinaryDocValues dv = ireader.leaves().get(0).reader().getBinaryDocValues("dv1");
       BytesRef scratch = dv.get(hits.scoreDocs[i].doc);
@@ -250,8 +251,8 @@ public abstract class BaseDocValuesForma
     assertEquals(1, hits.totalHits);
     // Iterate through the results:
     for (int i = 0; i < hits.scoreDocs.length; i++) {
-      StoredDocument hitDoc = isearcher.doc(hits.scoreDocs[i].doc);
-      assertEquals(text, hitDoc.get("fieldname"));
+      Document2 hitDoc = isearcher.doc(hits.scoreDocs[i].doc);
+      assertEquals(text, hitDoc.getString("fieldname"));
       assert ireader.leaves().size() == 1;
       NumericDocValues dv = ireader.leaves().get(0).reader().getNumericDocValues("dv1");
       assertEquals(5, dv.get(hits.scoreDocs[i].doc));
@@ -287,8 +288,8 @@ public abstract class BaseDocValuesForma
     assertEquals(1, hits.totalHits);
     // Iterate through the results:
     for (int i = 0; i < hits.scoreDocs.length; i++) {
-      StoredDocument hitDoc = isearcher.doc(hits.scoreDocs[i].doc);
-      assertEquals(text, hitDoc.get("fieldname"));
+      Document2 hitDoc = isearcher.doc(hits.scoreDocs[i].doc);
+      assertEquals(text, hitDoc.getString("fieldname"));
       assert ireader.leaves().size() == 1;
       SortedDocValues dv = ireader.leaves().get(0).reader().getSortedDocValues("dv1");
       int ord = dv.getOrd(0);
@@ -329,8 +330,8 @@ public abstract class BaseDocValuesForma
     BytesRef scratch = new BytesRef();
     // Iterate through the results:
     for (int i = 0; i < hits.scoreDocs.length; i++) {
-      StoredDocument hitDoc = isearcher.doc(hits.scoreDocs[i].doc);
-      assertEquals(text, hitDoc.get("fieldname"));
+      Document2 hitDoc = isearcher.doc(hits.scoreDocs[i].doc);
+      assertEquals(text, hitDoc.getString("fieldname"));
       assert ireader.leaves().size() == 1;
       SortedDocValues dv = ireader.leaves().get(0).reader().getSortedDocValues("dv2");
       int ord = dv.getOrd(0);
@@ -398,9 +399,9 @@ public abstract class BaseDocValuesForma
     assert ireader.leaves().size() == 1;
     NumericDocValues dv = ireader.leaves().get(0).reader().getNumericDocValues("dv");
     for(int i=0;i<2;i++) {
-      StoredDocument doc2 = ireader.leaves().get(0).reader().document(i);
+      Document2 doc2 = ireader.leaves().get(0).reader().document(i);
       long expected;
-      if (doc2.get("id").equals("0")) {
+      if (doc2.getString("id").equals("0")) {
         expected = -10;
       } else {
         expected = 99;
@@ -490,8 +491,8 @@ public abstract class BaseDocValuesForma
     assertEquals(1, hits.totalHits);
     // Iterate through the results:
     for (int i = 0; i < hits.scoreDocs.length; i++) {
-      StoredDocument hitDoc = isearcher.doc(hits.scoreDocs[i].doc);
-      assertEquals(text, hitDoc.get("fieldname"));
+      Document2 hitDoc = isearcher.doc(hits.scoreDocs[i].doc);
+      assertEquals(text, hitDoc.getString("fieldname"));
       assert ireader.leaves().size() == 1;
       BinaryDocValues dv = ireader.leaves().get(0).reader().getBinaryDocValues("dv");
       BytesRef scratch = dv.get(hits.scoreDocs[i].doc);
@@ -527,9 +528,9 @@ public abstract class BaseDocValuesForma
     BinaryDocValues dv = ireader.leaves().get(0).reader().getBinaryDocValues("dv");
     BytesRef scratch = new BytesRef();
     for(int i=0;i<2;i++) {
-      StoredDocument doc2 = ireader.leaves().get(0).reader().document(i);
+      Document2 doc2 = ireader.leaves().get(0).reader().document(i);
       String expected;
-      if (doc2.get("id").equals("0")) {
+      if (doc2.getString("id").equals("0")) {
         expected = "hello world 1";
       } else {
         expected = "hello 2";
@@ -595,8 +596,8 @@ public abstract class BaseDocValuesForma
     BytesRef scratch = new BytesRef();
     // Iterate through the results:
     for (int i = 0; i < hits.scoreDocs.length; i++) {
-      StoredDocument hitDoc = isearcher.doc(hits.scoreDocs[i].doc);
-      assertEquals(text, hitDoc.get("fieldname"));
+      Document2 hitDoc = isearcher.doc(hits.scoreDocs[i].doc);
+      assertEquals(text, hitDoc.getString("fieldname"));
       assert ireader.leaves().size() == 1;
       SortedDocValues dv = ireader.leaves().get(0).reader().getSortedDocValues("dv");
       scratch = dv.lookupOrd(dv.getOrd(hits.scoreDocs[i].doc));
@@ -702,9 +703,9 @@ public abstract class BaseDocValuesForma
     scratch = dv.lookupOrd(1);
     assertEquals(new BytesRef("hello world 2"), scratch);
     for(int i=0;i<2;i++) {
-      StoredDocument doc2 = ireader.leaves().get(0).reader().document(i);
+      Document2 doc2 = ireader.leaves().get(0).reader().document(i);
       String expected;
-      if (doc2.get("id").equals("0")) {
+      if (doc2.getString("id").equals("0")) {
         expected = "hello world 1";
       } else {
         expected = "hello world 2";
@@ -1226,7 +1227,7 @@ public abstract class BaseDocValuesForma
       LeafReader r = context.reader();
       NumericDocValues docValues = r.getNumericDocValues("dv");
       for (int i = 0; i < r.maxDoc(); i++) {
-        long storedValue = Long.parseLong(r.document(i).get("stored"));
+        long storedValue = Long.parseLong(r.document(i).getString("stored"));
         assertEquals(storedValue, docValues.get(i));
       }
     }
@@ -1284,7 +1285,7 @@ public abstract class BaseDocValuesForma
       LeafReader r = context.reader();
       SortedNumericDocValues docValues = DocValues.getSortedNumeric(r, "dv");
       for (int i = 0; i < r.maxDoc(); i++) {
-        String expected[] = r.document(i).getValues("stored");
+        String[] expected = r.document(i).getStrings("stored");
         docValues.setDocument(i);
         String actual[] = new String[docValues.count()];
         for (int j = 0; j < actual.length; j++) {
@@ -1377,7 +1378,7 @@ public abstract class BaseDocValuesForma
       LeafReader r = context.reader();
       BinaryDocValues docValues = r.getBinaryDocValues("dv");
       for (int i = 0; i < r.maxDoc(); i++) {
-        BytesRef binaryValue = r.document(i).getBinaryValue("stored");
+        BytesRef binaryValue = r.document(i).getBinary("stored");
         BytesRef scratch = docValues.get(i);
         assertEquals(binaryValue, scratch);
       }
@@ -1391,7 +1392,7 @@ public abstract class BaseDocValuesForma
       LeafReader r = context.reader();
       BinaryDocValues docValues = r.getBinaryDocValues("dv");
       for (int i = 0; i < r.maxDoc(); i++) {
-        BytesRef binaryValue = r.document(i).getBinaryValue("stored");
+        BytesRef binaryValue = r.document(i).getBinary("stored");
         BytesRef scratch = docValues.get(i);
         assertEquals(binaryValue, scratch);
       }
@@ -1460,7 +1461,7 @@ public abstract class BaseDocValuesForma
       LeafReader r = context.reader();
       BinaryDocValues docValues = r.getSortedDocValues("dv");
       for (int i = 0; i < r.maxDoc(); i++) {
-        BytesRef binaryValue = r.document(i).getBinaryValue("stored");
+        BytesRef binaryValue = r.document(i).getBinary("stored");
         BytesRef scratch = docValues.get(i);
         assertEquals(binaryValue, scratch);
       }
@@ -1474,7 +1475,7 @@ public abstract class BaseDocValuesForma
       LeafReader r = context.reader();
       BinaryDocValues docValues = r.getSortedDocValues("dv");
       for (int i = 0; i < r.maxDoc(); i++) {
-        BytesRef binaryValue = r.document(i).getBinaryValue("stored");
+        BytesRef binaryValue = r.document(i).getBinary("stored");
         BytesRef scratch = docValues.get(i);
         assertEquals(binaryValue, scratch);
       }
@@ -1991,7 +1992,7 @@ public abstract class BaseDocValuesForma
       LeafReader r = context.reader();
       SortedSetDocValues docValues = r.getSortedSetDocValues("dv");
       for (int i = 0; i < r.maxDoc(); i++) {
-        String stringValues[] = r.document(i).getValues("stored");
+        String stringValues[] = r.document(i).getStrings("stored");
         if (docValues != null) {
           docValues.setDocument(i);
         }
@@ -2014,7 +2015,7 @@ public abstract class BaseDocValuesForma
       LeafReader r = context.reader();
       SortedSetDocValues docValues = r.getSortedSetDocValues("dv");
       for (int i = 0; i < r.maxDoc(); i++) {
-        String stringValues[] = r.document(i).getValues("stored");
+        String stringValues[] = r.document(i).getStrings("stored");
         if (docValues != null) {
           docValues.setDocument(i);
         }
@@ -2425,12 +2426,12 @@ public abstract class BaseDocValuesForma
               SortedDocValues sorted = r.getSortedDocValues("dvSorted");
               NumericDocValues numerics = r.getNumericDocValues("dvNum");
               for (int j = 0; j < r.maxDoc(); j++) {
-                BytesRef binaryValue = r.document(j).getBinaryValue("storedBin");
+                BytesRef binaryValue = r.document(j).getBinary("storedBin");
                 BytesRef scratch = binaries.get(j);
                 assertEquals(binaryValue, scratch);
                 scratch = sorted.get(j);
                 assertEquals(binaryValue, scratch);
-                String expected = r.document(j).get("storedNum");
+                String expected = r.document(j).getString("storedNum");
                 assertEquals(Long.parseLong(expected), numerics.get(j));
               }
             }
@@ -2546,7 +2547,7 @@ public abstract class BaseDocValuesForma
               SortedNumericDocValues sortedNumeric = r.getSortedNumericDocValues("dvSortedNumeric");
               Bits sortedNumericBits = r.getDocsWithField("dvSortedNumeric");
               for (int j = 0; j < r.maxDoc(); j++) {
-                BytesRef binaryValue = r.document(j).getBinaryValue("storedBin");
+                BytesRef binaryValue = r.document(j).getBinary("storedBin");
                 if (binaryValue != null) {
                   if (binaries != null) {
                     BytesRef scratch = binaries.get(j);
@@ -2562,7 +2563,7 @@ public abstract class BaseDocValuesForma
                   assertEquals(-1, sorted.getOrd(j));
                 }
                
-                String number = r.document(j).get("storedNum");
+                String number = r.document(j).getString("storedNum");
                 if (number != null) {
                   if (numerics != null) {
                     assertEquals(Long.parseLong(number), numerics.get(j));
@@ -2572,7 +2573,7 @@ public abstract class BaseDocValuesForma
                   assertEquals(0, numerics.get(j));
                 }
                 
-                String values[] = r.document(j).getValues("storedSortedSet");
+                String values[] = r.document(j).getStrings("storedSortedSet");
                 if (values.length > 0) {
                   assertNotNull(sortedSet);
                   sortedSet.setDocument(j);
@@ -2590,7 +2591,7 @@ public abstract class BaseDocValuesForma
                   assertFalse(sortedSetBits.get(j));
                 }
                 
-                String numValues[] = r.document(j).getValues("storedSortedNumeric");
+                String numValues[] = r.document(j).getStrings("storedSortedNumeric");
                 if (numValues.length > 0) {
                   assertNotNull(sortedNumeric);
                   sortedNumeric.setDocument(j);

Modified: lucene/dev/branches/lucene6005/lucene/test-framework/src/java/org/apache/lucene/index/BaseNormsFormatTestCase.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene6005/lucene/test-framework/src/java/org/apache/lucene/index/BaseNormsFormatTestCase.java?rev=1635898&r1=1635897&r2=1635898&view=diff
==============================================================================
--- lucene/dev/branches/lucene6005/lucene/test-framework/src/java/org/apache/lucene/index/BaseNormsFormatTestCase.java (original)
+++ lucene/dev/branches/lucene6005/lucene/test-framework/src/java/org/apache/lucene/index/BaseNormsFormatTestCase.java Sat Nov  1 08:39:27 2014
@@ -225,7 +225,7 @@ public abstract class BaseNormsFormatTes
       LeafReader r = context.reader();
       NumericDocValues docValues = r.getNormValues("stored");
       for (int i = 0; i < r.maxDoc(); i++) {
-        long storedValue = Long.parseLong(r.document(i).get("stored"));
+        long storedValue = Long.parseLong(r.document(i).getString("stored"));
         assertEquals(storedValue, docValues.get(i));
       }
     }
@@ -239,7 +239,7 @@ public abstract class BaseNormsFormatTes
       LeafReader r = context.reader();
       NumericDocValues docValues = r.getNormValues("stored");
       for (int i = 0; i < r.maxDoc(); i++) {
-        long storedValue = Long.parseLong(r.document(i).get("stored"));
+        long storedValue = Long.parseLong(r.document(i).getString("stored"));
         assertEquals(storedValue, docValues.get(i));
       }
     }

Modified: lucene/dev/branches/lucene6005/lucene/test-framework/src/java/org/apache/lucene/index/BaseStoredFieldsFormatTestCase.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene6005/lucene/test-framework/src/java/org/apache/lucene/index/BaseStoredFieldsFormatTestCase.java?rev=1635898&r1=1635897&r2=1635898&view=diff
==============================================================================
--- lucene/dev/branches/lucene6005/lucene/test-framework/src/java/org/apache/lucene/index/BaseStoredFieldsFormatTestCase.java (original)
+++ lucene/dev/branches/lucene6005/lucene/test-framework/src/java/org/apache/lucene/index/BaseStoredFieldsFormatTestCase.java Sat Nov  1 08:39:27 2014
@@ -157,7 +157,7 @@ public abstract class BaseStoredFieldsFo
           }
           TopDocs hits = s.search(new TermQuery(new Term("id", testID)), 1);
           assertEquals(1, hits.totalHits);
-          StoredDocument doc = r.document(hits.scoreDocs[0].doc);
+          Document2 doc = r.document(hits.scoreDocs[0].doc);
           Document2 docExp = docs.get(testID);
           for(int i=0;i<fieldCount;i++) {
             assertEquals("doc " + testID + ", field f" + fieldCount + " is wrong", docExp.get("f"+i),  doc.get("f"+i));
@@ -184,20 +184,20 @@ public abstract class BaseStoredFieldsFo
     doc.add(newField("zzz", "1 2 3", customType));
     w.addDocument(doc);
     IndexReader r = w.getReader();
-    StoredDocument doc2 = r.document(0);
-    Iterator<StorableField> it = doc2.getFields().iterator();
+    Document2 doc2 = r.document(0);
+    Iterator<IndexableField> it = doc2.iterator();
     assertTrue(it.hasNext());
-    Field f = (Field) it.next();
+    IndexableField f = it.next();
     assertEquals(f.name(), "zzz");
     assertEquals(f.stringValue(), "a b c");
 
     assertTrue(it.hasNext());
-    f = (Field) it.next();
+    f = it.next();
     assertEquals(f.name(), "aaa");
     assertEquals(f.stringValue(), "a b c");
 
     assertTrue(it.hasNext());
-    f = (Field) it.next();
+    f = it.next();
     assertEquals(f.name(), "zzz");
     assertEquals(f.stringValue(), "1 2 3");
     assertFalse(it.hasNext());
@@ -226,8 +226,8 @@ public abstract class BaseStoredFieldsFo
     w.close();
 
     IndexReader ir = DirectoryReader.open(dir);
-    StoredDocument doc2 = ir.document(0);
-    StorableField f2 = doc2.getField("binary");
+    Document2 doc2 = ir.document(0);
+    IndexableField f2 = doc2.getField("binary");
     b = f2.binaryValue().bytes;
     assertTrue(b != null);
     assertEquals(17, b.length, 17);
@@ -290,8 +290,8 @@ public abstract class BaseStoredFieldsFo
     final int docID = random().nextInt(100);
     for (Field fld : fields) {
       String fldName = fld.name();
-      final StoredDocument sDoc = reader.document(docID, Collections.singleton(fldName));
-      final StorableField sField = sDoc.getField(fldName);
+      final Document2 sDoc = reader.document(docID, Collections.singleton(fldName));
+      final IndexableField sField = sDoc.getField(fldName);
       if (Field.class.equals(fld.getClass())) {
         assertEquals(fld.binaryValue(), sField.binaryValue());
         assertEquals(fld.stringValue(), sField.stringValue());
@@ -319,7 +319,7 @@ public abstract class BaseStoredFieldsFo
     iw.commit();
     final DirectoryReader rd = DirectoryReader.open(dir);
     for (int i = 0; i < numDocs; ++i) {
-      final StoredDocument doc = rd.document(i);
+      final Document2 doc = rd.document(i);
       assertNotNull(doc);
       assertTrue(doc.getFields().isEmpty());
     }
@@ -371,7 +371,7 @@ public abstract class BaseStoredFieldsFo
               if (topDocs.totalHits != 1) {
                 throw new IllegalStateException("Expected 1 hit, got " + topDocs.totalHits);
               }
-              final StoredDocument sdoc = rd.document(topDocs.scoreDocs[0].doc);
+              final Document2 sdoc = rd.document(topDocs.scoreDocs[0].doc);
               if (sdoc == null || sdoc.get("fld") == null) {
                 throw new IllegalStateException("Could not find document " + q);
               }
@@ -472,7 +472,7 @@ public abstract class BaseStoredFieldsFo
     assertTrue(ir.numDocs() > 0);
     int numDocs = 0;
     for (int i = 0; i < ir.maxDoc(); ++i) {
-      final StoredDocument doc = ir.document(i);
+      final Document2 doc = ir.document(i);
       if (doc == null) {
         continue;
       }
@@ -481,7 +481,7 @@ public abstract class BaseStoredFieldsFo
       assertEquals(data[docId].length + 1, doc.getFields().size());
       for (int j = 0; j < data[docId].length; ++j) {
         final byte[] arr = data[docId][j];
-        final BytesRef arr2Ref = doc.getBinaryValue("bytes" + j);
+        final BytesRef arr2Ref = doc.getBinary("bytes" + j);
         final byte[] arr2 = Arrays.copyOfRange(arr2Ref.bytes, arr2Ref.offset, arr2Ref.offset + arr2Ref.length);
         assertArrayEquals(arr, arr2);
       }
@@ -553,12 +553,12 @@ public abstract class BaseStoredFieldsFo
       final Query query = new TermQuery(new Term("id", "" + i));
       final TopDocs topDocs = searcher.search(query, 1);
       assertEquals("" + i, 1, topDocs.totalHits);
-      final StoredDocument doc = rd.document(topDocs.scoreDocs[0].doc);
+      final Document2 doc = rd.document(topDocs.scoreDocs[0].doc);
       assertNotNull(doc);
-      final StorableField[] fieldValues = doc.getFields("fld");
-      assertEquals(docs[i].getFields("fld").length, fieldValues.length);
-      if (fieldValues.length > 0) {
-        assertEquals(docs[i].getFields("fld")[0].binaryValue(), fieldValues[0].binaryValue());
+      final List<IndexableField> fieldValues = doc.getFields("fld");
+      assertEquals(docs[i].getFields("fld").length, fieldValues.size());
+      if (fieldValues.size() > 0) {
+        assertEquals(docs[i].getFields("fld")[0].binaryValue(), fieldValues.get(0).binaryValue());
       }
     }
     rd.close();

Modified: lucene/dev/branches/lucene6005/lucene/test-framework/src/java/org/apache/lucene/index/DocHelper.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene6005/lucene/test-framework/src/java/org/apache/lucene/index/DocHelper.java?rev=1635898&r1=1635897&r2=1635898&view=diff
==============================================================================
--- lucene/dev/branches/lucene6005/lucene/test-framework/src/java/org/apache/lucene/index/DocHelper.java (original)
+++ lucene/dev/branches/lucene6005/lucene/test-framework/src/java/org/apache/lucene/index/DocHelper.java Sat Nov  1 08:39:27 2014
@@ -270,7 +270,7 @@ class DocHelper {
     return 14;
   }
 
-  public static int numFields(StoredDocument doc) {
+  public static int numFields(Document2 doc) {
     return doc.getFields().size();
   }
   

Modified: lucene/dev/branches/lucene6005/lucene/test-framework/src/java/org/apache/lucene/index/RandomIndexWriter.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene6005/lucene/test-framework/src/java/org/apache/lucene/index/RandomIndexWriter.java?rev=1635898&r1=1635897&r2=1635898&view=diff
==============================================================================
--- lucene/dev/branches/lucene6005/lucene/test-framework/src/java/org/apache/lucene/index/RandomIndexWriter.java (original)
+++ lucene/dev/branches/lucene6005/lucene/test-framework/src/java/org/apache/lucene/index/RandomIndexWriter.java Sat Nov  1 08:39:27 2014
@@ -109,23 +109,23 @@ public class RandomIndexWriter implement
    * Adds a Document.
    * @see IndexWriter#addDocument(org.apache.lucene.index.IndexDocument)
    */
-  public <T extends IndexableField> void addDocument(final IndexDocument doc) throws IOException {
+  public <T extends IndexableField> void addDocument(final Iterable<T> doc) throws IOException {
     LuceneTestCase.maybeChangeLiveIndexWriterConfig(r, w.getConfig());
     addDocument(doc, w.getAnalyzer());
   }
 
-  public <T extends IndexableField> void addDocument(final IndexDocument doc, Analyzer a) throws IOException {
+  public <T extends IndexableField> void addDocument(final Iterable<T> doc, Analyzer a) throws IOException {
     LuceneTestCase.maybeChangeLiveIndexWriterConfig(r, w.getConfig());
     if (r.nextInt(5) == 3) {
       // TODO: maybe, we should simply buffer up added docs
       // (but we need to clone them), and only when
       // getReader, commit, etc. are called, we do an
       // addDocuments?  Would be better testing.
-      w.addDocuments(new Iterable<IndexDocument>() {
+      w.addDocuments(new Iterable<Iterable<T>>() {
 
         @Override
-        public Iterator<IndexDocument> iterator() {
-          return new Iterator<IndexDocument>() {
+        public Iterator<Iterable<T>> iterator() {
+          return new Iterator<Iterable<T>>() {
             boolean done;
             
             @Override
@@ -139,7 +139,7 @@ public class RandomIndexWriter implement
             }
 
             @Override
-            public IndexDocument next() {
+            public Iterable<T> next() {
               if (done) {
                 throw new IllegalStateException();
               }
@@ -171,13 +171,13 @@ public class RandomIndexWriter implement
     }
   }
   
-  public void addDocuments(Iterable<? extends IndexDocument> docs) throws IOException {
+  public void addDocuments(Iterable<? extends Iterable<? extends IndexableField>> docs) throws IOException {
     LuceneTestCase.maybeChangeLiveIndexWriterConfig(r, w.getConfig());
     w.addDocuments(docs);
     maybeCommit();
   }
 
-  public void updateDocuments(Term delTerm, Iterable<? extends IndexDocument> docs) throws IOException {
+  public void updateDocuments(Term delTerm, Iterable<? extends Iterable<? extends IndexableField>> docs) throws IOException {
     LuceneTestCase.maybeChangeLiveIndexWriterConfig(r, w.getConfig());
     w.updateDocuments(delTerm, docs);
     maybeCommit();
@@ -187,14 +187,14 @@ public class RandomIndexWriter implement
    * Updates a document.
    * @see IndexWriter#updateDocument(Term, org.apache.lucene.index.IndexDocument)
    */
-  public <T extends IndexableField> void updateDocument(Term t, final IndexDocument doc) throws IOException {
+  public <T extends IndexableField> void updateDocument(Term t, final Iterable<T> doc) throws IOException {
     LuceneTestCase.maybeChangeLiveIndexWriterConfig(r, w.getConfig());
     if (r.nextInt(5) == 3) {
-      w.updateDocuments(t, new Iterable<IndexDocument>() {
+      w.updateDocuments(t, new Iterable<Iterable<T>>() {
 
         @Override
-        public Iterator<IndexDocument> iterator() {
-          return new Iterator<IndexDocument>() {
+        public Iterator<Iterable<T>> iterator() {
+          return new Iterator<Iterable<T>>() {
             boolean done;
             
             @Override
@@ -208,7 +208,7 @@ public class RandomIndexWriter implement
             }
 
             @Override
-            public IndexDocument next() {
+            public Iterable<T> next() {
               if (done) {
                 throw new IllegalStateException();
               }

Modified: lucene/dev/branches/lucene6005/lucene/test-framework/src/java/org/apache/lucene/index/ThreadedIndexingAndSearchingTestCase.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene6005/lucene/test-framework/src/java/org/apache/lucene/index/ThreadedIndexingAndSearchingTestCase.java?rev=1635898&r1=1635897&r2=1635898&view=diff
==============================================================================
--- lucene/dev/branches/lucene6005/lucene/test-framework/src/java/org/apache/lucene/index/ThreadedIndexingAndSearchingTestCase.java (original)
+++ lucene/dev/branches/lucene6005/lucene/test-framework/src/java/org/apache/lucene/index/ThreadedIndexingAndSearchingTestCase.java Sat Nov  1 08:39:27 2014
@@ -27,6 +27,7 @@ import java.util.concurrent.atomic.Atomi
 import java.util.concurrent.atomic.AtomicInteger;
 
 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.search.IndexSearcher;
@@ -91,19 +92,19 @@ public abstract class ThreadedIndexingAn
     return in;
   }
 
-  protected void updateDocuments(Term id, List<? extends IndexDocument> docs) throws Exception {
+  protected void updateDocuments(Term id, List<? extends Iterable<? extends IndexableField>> docs) throws Exception {
     writer.updateDocuments(id, docs);
   }
 
-  protected void addDocuments(Term id, List<? extends IndexDocument> docs) throws Exception {
+  protected void addDocuments(Term id, List<? extends Iterable<? extends IndexableField>> docs) throws Exception {
     writer.addDocuments(docs);
   }
 
-  protected void addDocument(Term id, IndexDocument doc) throws Exception {
+  protected void addDocument(Term id, Iterable<? extends IndexableField> doc) throws Exception {
     writer.addDocument(doc);
   }
 
-  protected void updateDocument(Term term, IndexDocument doc) throws Exception {
+  protected void updateDocument(Term term, Iterable<? extends IndexableField> doc) throws Exception {
     writer.updateDocument(term, doc);
   }
 
@@ -476,7 +477,7 @@ public abstract class ThreadedIndexingAn
         final int inc = Math.max(1, maxDoc/50);
         for(int docID=0;docID<maxDoc;docID += inc) {
           if (liveDocs == null || liveDocs.get(docID)) {
-            final StoredDocument doc = reader.document(docID);
+            final Document2 doc = reader.document(docID);
             sum += doc.getFields().size();
           }
         }
@@ -587,7 +588,7 @@ public abstract class ThreadedIndexingAn
               startDocID = docID;
             }
             lastDocID = docID;
-            final StoredDocument doc = s.doc(docID);
+            final Document2 doc = s.doc(docID);
             assertEquals(subDocs.packID, doc.get("packID"));
           }
 

Modified: lucene/dev/branches/lucene6005/lucene/test-framework/src/java/org/apache/lucene/util/LuceneTestCase.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene6005/lucene/test-framework/src/java/org/apache/lucene/util/LuceneTestCase.java?rev=1635898&r1=1635897&r2=1635898&view=diff
==============================================================================
--- lucene/dev/branches/lucene6005/lucene/test-framework/src/java/org/apache/lucene/util/LuceneTestCase.java (original)
+++ lucene/dev/branches/lucene6005/lucene/test-framework/src/java/org/apache/lucene/util/LuceneTestCase.java Sat Nov  1 08:39:27 2014
@@ -57,6 +57,7 @@ import java.util.logging.Logger;
 
 import org.apache.lucene.analysis.Analyzer;
 import org.apache.lucene.analysis.MockAnalyzer;
+import org.apache.lucene.document.Document2;
 import org.apache.lucene.document.Field.Store;
 import org.apache.lucene.document.Field;
 import org.apache.lucene.document.FieldType;
@@ -79,6 +80,7 @@ import org.apache.lucene.index.IndexRead
 import org.apache.lucene.index.IndexReader;
 import org.apache.lucene.index.IndexWriter;
 import org.apache.lucene.index.IndexWriterConfig;
+import org.apache.lucene.index.IndexableField;
 import org.apache.lucene.index.LeafReader;
 import org.apache.lucene.index.LeafReaderContext;
 import org.apache.lucene.index.LiveIndexWriterConfig;
@@ -100,8 +102,6 @@ import org.apache.lucene.index.SlowCompo
 import org.apache.lucene.index.SortedDocValues;
 import org.apache.lucene.index.SortedNumericDocValues;
 import org.apache.lucene.index.SortedSetDocValues;
-import org.apache.lucene.index.StorableField;
-import org.apache.lucene.index.StoredDocument;
 import org.apache.lucene.index.Terms;
 import org.apache.lucene.index.TermsEnum.SeekStatus;
 import org.apache.lucene.index.TermsEnum;
@@ -1357,6 +1357,8 @@ public abstract class LuceneTestCase ext
     return newType;
   }
 
+  // nocommit can we use FieldTypes here?
+
   // TODO: if we can pull out the "make term vector options
   // consistent across all instances of the same field name"
   // write-once schema sort of helper class then we can
@@ -2170,25 +2172,25 @@ public abstract class LuceneTestCase ext
   public void assertStoredFieldsEquals(String info, IndexReader leftReader, IndexReader rightReader) throws IOException {
     assert leftReader.maxDoc() == rightReader.maxDoc();
     for (int i = 0; i < leftReader.maxDoc(); i++) {
-      StoredDocument leftDoc = leftReader.document(i);
-      StoredDocument rightDoc = rightReader.document(i);
+      Document2 leftDoc = leftReader.document(i);
+      Document2 rightDoc = rightReader.document(i);
       
       // TODO: I think this is bogus because we don't document what the order should be
       // from these iterators, etc. I think the codec/IndexReader should be free to order this stuff
       // in whatever way it wants (e.g. maybe it packs related fields together or something)
       // To fix this, we sort the fields in both documents by name, but
       // we still assume that all instances with same name are in order:
-      Comparator<StorableField> comp = new Comparator<StorableField>() {
+      Comparator<IndexableField> comp = new Comparator<IndexableField>() {
         @Override
-        public int compare(StorableField arg0, StorableField arg1) {
+        public int compare(IndexableField arg0, IndexableField arg1) {
           return arg0.name().compareTo(arg1.name());
         }        
       };
       Collections.sort(leftDoc.getFields(), comp);
       Collections.sort(rightDoc.getFields(), comp);
 
-      Iterator<StorableField> leftIterator = leftDoc.iterator();
-      Iterator<StorableField> rightIterator = rightDoc.iterator();
+      Iterator<IndexableField> leftIterator = leftDoc.iterator();
+      Iterator<IndexableField> rightIterator = rightDoc.iterator();
       while (leftIterator.hasNext()) {
         assertTrue(info, rightIterator.hasNext());
         assertStoredFieldEquals(info, leftIterator.next(), rightIterator.next());
@@ -2200,7 +2202,7 @@ public abstract class LuceneTestCase ext
   /** 
    * checks that two stored fields are equivalent 
    */
-  public void assertStoredFieldEquals(String info, StorableField leftField, StorableField rightField) {
+  public void assertStoredFieldEquals(String info, IndexableField leftField, IndexableField rightField) {
     assertEquals(info, leftField.name(), rightField.name());
     assertEquals(info, leftField.binaryValue(), rightField.binaryValue());
     assertEquals(info, leftField.stringValue(), rightField.stringValue());



Mime
View raw message