lucene-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mikemcc...@apache.org
Subject svn commit: r1635898 [1/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
Author: mikemccand
Date: Sat Nov  1 08:39:27 2014
New Revision: 1635898

URL: http://svn.apache.org/r1635898
Log:
LUCENE-6005: StoredDocument -> Document2

Added:
    lucene/dev/branches/lucene6005/lucene/core/src/java/org/apache/lucene/document/Document2StoredFieldVisitor.java   (with props)
Removed:
    lucene/dev/branches/lucene6005/lucene/core/src/java/org/apache/lucene/document/DocumentStoredFieldVisitor.java
    lucene/dev/branches/lucene6005/lucene/core/src/java/org/apache/lucene/index/GeneralField.java
    lucene/dev/branches/lucene6005/lucene/core/src/java/org/apache/lucene/index/IndexDocument.java
    lucene/dev/branches/lucene6005/lucene/core/src/java/org/apache/lucene/index/StorableField.java
    lucene/dev/branches/lucene6005/lucene/core/src/java/org/apache/lucene/index/StoredDocument.java
Modified:
    lucene/dev/branches/lucene6005/lucene/analysis/common/src/test/org/apache/lucene/collation/TestCollationDocValuesField.java
    lucene/dev/branches/lucene6005/lucene/analysis/icu/src/test/org/apache/lucene/collation/TestICUCollationDocValuesField.java
    lucene/dev/branches/lucene6005/lucene/analysis/uima/src/test/org/apache/lucene/analysis/uima/UIMABaseAnalyzerTest.java
    lucene/dev/branches/lucene6005/lucene/backward-codecs/src/test/org/apache/lucene/index/TestBackwardsCompatibility.java
    lucene/dev/branches/lucene6005/lucene/benchmark/src/java/org/apache/lucene/benchmark/byTask/tasks/BenchmarkHighlighter.java
    lucene/dev/branches/lucene6005/lucene/benchmark/src/java/org/apache/lucene/benchmark/byTask/tasks/ReadTask.java
    lucene/dev/branches/lucene6005/lucene/benchmark/src/java/org/apache/lucene/benchmark/byTask/tasks/ReadTokensTask.java
    lucene/dev/branches/lucene6005/lucene/benchmark/src/java/org/apache/lucene/benchmark/byTask/tasks/SearchTravRetHighlightTask.java
    lucene/dev/branches/lucene6005/lucene/benchmark/src/java/org/apache/lucene/benchmark/byTask/tasks/SearchTravRetLoadFieldSelectorTask.java
    lucene/dev/branches/lucene6005/lucene/benchmark/src/java/org/apache/lucene/benchmark/byTask/tasks/SearchTravRetVectorHighlightTask.java
    lucene/dev/branches/lucene6005/lucene/benchmark/src/java/org/apache/lucene/benchmark/byTask/tasks/WriteEnwikiLineDocTask.java
    lucene/dev/branches/lucene6005/lucene/benchmark/src/java/org/apache/lucene/benchmark/byTask/tasks/WriteLineDocTask.java
    lucene/dev/branches/lucene6005/lucene/benchmark/src/test/org/apache/lucene/benchmark/byTask/tasks/CountingHighlighterTestTask.java
    lucene/dev/branches/lucene6005/lucene/classification/src/java/org/apache/lucene/classification/BooleanPerceptronClassifier.java
    lucene/dev/branches/lucene6005/lucene/classification/src/java/org/apache/lucene/classification/utils/DatasetSplitter.java
    lucene/dev/branches/lucene6005/lucene/codecs/src/java/org/apache/lucene/codecs/simpletext/SimpleTextStoredFieldsWriter.java
    lucene/dev/branches/lucene6005/lucene/core/src/java/org/apache/lucene/codecs/StoredFieldsWriter.java
    lucene/dev/branches/lucene6005/lucene/core/src/java/org/apache/lucene/codecs/compressing/CompressingStoredFieldsWriter.java
    lucene/dev/branches/lucene6005/lucene/core/src/java/org/apache/lucene/document/Document.java
    lucene/dev/branches/lucene6005/lucene/core/src/java/org/apache/lucene/document/Document2.java
    lucene/dev/branches/lucene6005/lucene/core/src/java/org/apache/lucene/document/Field.java
    lucene/dev/branches/lucene6005/lucene/core/src/java/org/apache/lucene/document/FieldTypes.java
    lucene/dev/branches/lucene6005/lucene/core/src/java/org/apache/lucene/document/StoredField.java
    lucene/dev/branches/lucene6005/lucene/core/src/java/org/apache/lucene/index/CheckIndex.java
    lucene/dev/branches/lucene6005/lucene/core/src/java/org/apache/lucene/index/DefaultIndexingChain.java
    lucene/dev/branches/lucene6005/lucene/core/src/java/org/apache/lucene/index/DocumentsWriter.java
    lucene/dev/branches/lucene6005/lucene/core/src/java/org/apache/lucene/index/DocumentsWriterPerThread.java
    lucene/dev/branches/lucene6005/lucene/core/src/java/org/apache/lucene/index/IndexReader.java
    lucene/dev/branches/lucene6005/lucene/core/src/java/org/apache/lucene/index/IndexWriter.java
    lucene/dev/branches/lucene6005/lucene/core/src/java/org/apache/lucene/index/IndexableField.java
    lucene/dev/branches/lucene6005/lucene/core/src/java/org/apache/lucene/index/MergeState.java
    lucene/dev/branches/lucene6005/lucene/core/src/java/org/apache/lucene/index/ReadersAndUpdates.java
    lucene/dev/branches/lucene6005/lucene/core/src/java/org/apache/lucene/index/SegmentMerger.java
    lucene/dev/branches/lucene6005/lucene/core/src/java/org/apache/lucene/index/SegmentReader.java
    lucene/dev/branches/lucene6005/lucene/core/src/java/org/apache/lucene/index/StandardDirectoryReader.java
    lucene/dev/branches/lucene6005/lucene/core/src/java/org/apache/lucene/index/StoredFieldVisitor.java
    lucene/dev/branches/lucene6005/lucene/core/src/java/org/apache/lucene/index/TrackingIndexWriter.java
    lucene/dev/branches/lucene6005/lucene/core/src/java/org/apache/lucene/search/IndexSearcher.java
    lucene/dev/branches/lucene6005/lucene/core/src/test/org/apache/lucene/TestDemo.java
    lucene/dev/branches/lucene6005/lucene/core/src/test/org/apache/lucene/TestSearch.java
    lucene/dev/branches/lucene6005/lucene/core/src/test/org/apache/lucene/TestSearchForDuplicates.java
    lucene/dev/branches/lucene6005/lucene/core/src/test/org/apache/lucene/codecs/lucene50/TestBlockPostingsFormat2.java
    lucene/dev/branches/lucene6005/lucene/core/src/test/org/apache/lucene/codecs/perfield/TestPerFieldDocValuesFormat.java
    lucene/dev/branches/lucene6005/lucene/core/src/test/org/apache/lucene/document/TestBinaryDocument.java
    lucene/dev/branches/lucene6005/lucene/core/src/test/org/apache/lucene/document/TestDocument.java
    lucene/dev/branches/lucene6005/lucene/core/src/test/org/apache/lucene/document/TestDocument2.java
    lucene/dev/branches/lucene6005/lucene/core/src/test/org/apache/lucene/index/Test4GBStoredFields.java
    lucene/dev/branches/lucene6005/lucene/core/src/test/org/apache/lucene/index/TestAddIndexes.java
    lucene/dev/branches/lucene6005/lucene/core/src/test/org/apache/lucene/index/TestCustomNorms.java
    lucene/dev/branches/lucene6005/lucene/core/src/test/org/apache/lucene/index/TestDirectoryReader.java
    lucene/dev/branches/lucene6005/lucene/core/src/test/org/apache/lucene/index/TestDirectoryReaderReopen.java
    lucene/dev/branches/lucene6005/lucene/core/src/test/org/apache/lucene/index/TestDoc.java
    lucene/dev/branches/lucene6005/lucene/core/src/test/org/apache/lucene/index/TestDocValuesIndexing.java
    lucene/dev/branches/lucene6005/lucene/core/src/test/org/apache/lucene/index/TestDocumentWriter.java
    lucene/dev/branches/lucene6005/lucene/core/src/test/org/apache/lucene/index/TestFieldReuse.java
    lucene/dev/branches/lucene6005/lucene/core/src/test/org/apache/lucene/index/TestFieldsReader.java
    lucene/dev/branches/lucene6005/lucene/core/src/test/org/apache/lucene/index/TestIndexWriter.java
    lucene/dev/branches/lucene6005/lucene/core/src/test/org/apache/lucene/index/TestIndexWriterExceptions.java
    lucene/dev/branches/lucene6005/lucene/core/src/test/org/apache/lucene/index/TestIndexWriterMerging.java
    lucene/dev/branches/lucene6005/lucene/core/src/test/org/apache/lucene/index/TestIndexWriterReader.java
    lucene/dev/branches/lucene6005/lucene/core/src/test/org/apache/lucene/index/TestIndexWriterThreadsToSegments.java
    lucene/dev/branches/lucene6005/lucene/core/src/test/org/apache/lucene/index/TestIndexWriterUnicode.java
    lucene/dev/branches/lucene6005/lucene/core/src/test/org/apache/lucene/index/TestIndexableField.java
    lucene/dev/branches/lucene6005/lucene/core/src/test/org/apache/lucene/index/TestNorms.java
    lucene/dev/branches/lucene6005/lucene/core/src/test/org/apache/lucene/index/TestParallelCompositeReader.java
    lucene/dev/branches/lucene6005/lucene/core/src/test/org/apache/lucene/index/TestParallelLeafReader.java
    lucene/dev/branches/lucene6005/lucene/core/src/test/org/apache/lucene/index/TestPostingsOffsets.java
    lucene/dev/branches/lucene6005/lucene/core/src/test/org/apache/lucene/index/TestRollingUpdates.java
    lucene/dev/branches/lucene6005/lucene/core/src/test/org/apache/lucene/index/TestSegmentMerger.java
    lucene/dev/branches/lucene6005/lucene/core/src/test/org/apache/lucene/index/TestSegmentReader.java
    lucene/dev/branches/lucene6005/lucene/core/src/test/org/apache/lucene/index/TestSegmentTermDocs.java
    lucene/dev/branches/lucene6005/lucene/core/src/test/org/apache/lucene/index/TestStressAdvance.java
    lucene/dev/branches/lucene6005/lucene/core/src/test/org/apache/lucene/index/TestStressIndexing2.java
    lucene/dev/branches/lucene6005/lucene/core/src/test/org/apache/lucene/index/TestStressNRT.java
    lucene/dev/branches/lucene6005/lucene/core/src/test/org/apache/lucene/index/TestTermsEnum.java
    lucene/dev/branches/lucene6005/lucene/core/src/test/org/apache/lucene/index/TestTransactionRollback.java
    lucene/dev/branches/lucene6005/lucene/core/src/test/org/apache/lucene/search/TestBooleanMinShouldMatch.java
    lucene/dev/branches/lucene6005/lucene/core/src/test/org/apache/lucene/search/TestControlledRealTimeReopenThread.java
    lucene/dev/branches/lucene6005/lucene/core/src/test/org/apache/lucene/search/TestDateSort.java
    lucene/dev/branches/lucene6005/lucene/core/src/test/org/apache/lucene/search/TestDisjunctionMaxQuery.java
    lucene/dev/branches/lucene6005/lucene/core/src/test/org/apache/lucene/search/TestFuzzyQuery.java
    lucene/dev/branches/lucene6005/lucene/core/src/test/org/apache/lucene/search/TestLiveFieldValues.java
    lucene/dev/branches/lucene6005/lucene/core/src/test/org/apache/lucene/search/TestNumericRangeQuery32.java
    lucene/dev/branches/lucene6005/lucene/core/src/test/org/apache/lucene/search/TestNumericRangeQuery64.java
    lucene/dev/branches/lucene6005/lucene/core/src/test/org/apache/lucene/search/TestQueryRescorer.java
    lucene/dev/branches/lucene6005/lucene/core/src/test/org/apache/lucene/search/TestSortRescorer.java
    lucene/dev/branches/lucene6005/lucene/core/src/test/org/apache/lucene/search/spans/TestSpansAdvanced.java
    lucene/dev/branches/lucene6005/lucene/core/src/test/org/apache/lucene/store/TestRAMDirectory.java
    lucene/dev/branches/lucene6005/lucene/demo/src/java/org/apache/lucene/demo/SearchFiles.java
    lucene/dev/branches/lucene6005/lucene/demo/src/java/org/apache/lucene/demo/xmlparser/FormBasedXmlQueryDemo.java
    lucene/dev/branches/lucene6005/lucene/facet/src/java/org/apache/lucene/facet/FacetsConfig.java
    lucene/dev/branches/lucene6005/lucene/facet/src/java/org/apache/lucene/facet/taxonomy/directory/DirectoryTaxonomyReader.java
    lucene/dev/branches/lucene6005/lucene/facet/src/test/org/apache/lucene/facet/TestDrillSideways.java
    lucene/dev/branches/lucene6005/lucene/grouping/src/test/org/apache/lucene/search/grouping/DistinctValuesCollectorTest.java
    lucene/dev/branches/lucene6005/lucene/highlighter/src/java/org/apache/lucene/search/highlight/TokenSources.java
    lucene/dev/branches/lucene6005/lucene/highlighter/src/test/org/apache/lucene/search/highlight/HighlighterTest.java
    lucene/dev/branches/lucene6005/lucene/highlighter/src/test/org/apache/lucene/search/postingshighlight/TestPostingsHighlighter.java
    lucene/dev/branches/lucene6005/lucene/join/src/test/org/apache/lucene/search/join/TestBlockJoin.java
    lucene/dev/branches/lucene6005/lucene/memory/src/test/org/apache/lucene/index/memory/TestMemoryIndexAgainstRAMDir.java
    lucene/dev/branches/lucene6005/lucene/misc/src/java/org/apache/lucene/document/LazyDocument.java
    lucene/dev/branches/lucene6005/lucene/misc/src/test/org/apache/lucene/document/TestLazyDocument.java
    lucene/dev/branches/lucene6005/lucene/misc/src/test/org/apache/lucene/index/TestMultiPassIndexSplitter.java
    lucene/dev/branches/lucene6005/lucene/misc/src/test/org/apache/lucene/index/sorter/IndexSortingTest.java
    lucene/dev/branches/lucene6005/lucene/misc/src/test/org/apache/lucene/index/sorter/SorterTestBase.java
    lucene/dev/branches/lucene6005/lucene/misc/src/test/org/apache/lucene/uninverting/TestFieldCacheSort.java
    lucene/dev/branches/lucene6005/lucene/misc/src/test/org/apache/lucene/uninverting/TestFieldCacheVsDocValues.java
    lucene/dev/branches/lucene6005/lucene/queries/src/java/org/apache/lucene/queries/mlt/MoreLikeThis.java
    lucene/dev/branches/lucene6005/lucene/queries/src/test/org/apache/lucene/queries/TestCustomScoreQuery.java
    lucene/dev/branches/lucene6005/lucene/queries/src/test/org/apache/lucene/queries/function/TestFieldScoreQuery.java
    lucene/dev/branches/lucene6005/lucene/queries/src/test/org/apache/lucene/queries/function/TestFunctionQuerySort.java
    lucene/dev/branches/lucene6005/lucene/queryparser/src/test/org/apache/lucene/queryparser/complexPhrase/TestComplexPhraseQuery.java
    lucene/dev/branches/lucene6005/lucene/queryparser/src/test/org/apache/lucene/queryparser/xml/TestParser.java
    lucene/dev/branches/lucene6005/lucene/sandbox/src/test/org/apache/lucene/sandbox/queries/DuplicateFilterTest.java
    lucene/dev/branches/lucene6005/lucene/sandbox/src/test/org/apache/lucene/sandbox/queries/FuzzyLikeThisQueryTest.java
    lucene/dev/branches/lucene6005/lucene/sandbox/src/test/org/apache/lucene/sandbox/queries/TestSlowCollationMethods.java
    lucene/dev/branches/lucene6005/lucene/sandbox/src/test/org/apache/lucene/sandbox/queries/TestSlowFuzzyQuery.java
    lucene/dev/branches/lucene6005/lucene/sandbox/src/test/org/apache/lucene/search/TestTermAutomatonQuery.java
    lucene/dev/branches/lucene6005/lucene/spatial/src/test/org/apache/lucene/spatial/PortedSolr3Test.java
    lucene/dev/branches/lucene6005/lucene/spatial/src/test/org/apache/lucene/spatial/SpatialExample.java
    lucene/dev/branches/lucene6005/lucene/spatial/src/test/org/apache/lucene/spatial/SpatialTestCase.java
    lucene/dev/branches/lucene6005/lucene/spatial/src/test/org/apache/lucene/spatial/StrategyTestCase.java
    lucene/dev/branches/lucene6005/lucene/spatial/src/test/org/apache/lucene/spatial/prefix/TestRecursivePrefixTreeStrategy.java
    lucene/dev/branches/lucene6005/lucene/suggest/src/java/org/apache/lucene/search/spell/SpellChecker.java
    lucene/dev/branches/lucene6005/lucene/suggest/src/java/org/apache/lucene/search/suggest/DocumentDictionary.java
    lucene/dev/branches/lucene6005/lucene/suggest/src/java/org/apache/lucene/search/suggest/DocumentValueSourceDictionary.java
    lucene/dev/branches/lucene6005/lucene/suggest/src/test/org/apache/lucene/search/suggest/DocumentDictionaryTest.java
    lucene/dev/branches/lucene6005/lucene/suggest/src/test/org/apache/lucene/search/suggest/DocumentValueSourceDictionaryTest.java
    lucene/dev/branches/lucene6005/lucene/test-framework/src/java/org/apache/lucene/analysis/CollationTestBase.java
    lucene/dev/branches/lucene6005/lucene/test-framework/src/java/org/apache/lucene/codecs/asserting/AssertingStoredFieldsFormat.java
    lucene/dev/branches/lucene6005/lucene/test-framework/src/java/org/apache/lucene/codecs/cranky/CrankyStoredFieldsFormat.java
    lucene/dev/branches/lucene6005/lucene/test-framework/src/java/org/apache/lucene/index/BaseDocValuesFormatTestCase.java
    lucene/dev/branches/lucene6005/lucene/test-framework/src/java/org/apache/lucene/index/BaseNormsFormatTestCase.java
    lucene/dev/branches/lucene6005/lucene/test-framework/src/java/org/apache/lucene/index/BaseStoredFieldsFormatTestCase.java
    lucene/dev/branches/lucene6005/lucene/test-framework/src/java/org/apache/lucene/index/DocHelper.java
    lucene/dev/branches/lucene6005/lucene/test-framework/src/java/org/apache/lucene/index/RandomIndexWriter.java
    lucene/dev/branches/lucene6005/lucene/test-framework/src/java/org/apache/lucene/index/ThreadedIndexingAndSearchingTestCase.java
    lucene/dev/branches/lucene6005/lucene/test-framework/src/java/org/apache/lucene/util/LuceneTestCase.java

Modified: lucene/dev/branches/lucene6005/lucene/analysis/common/src/test/org/apache/lucene/collation/TestCollationDocValuesField.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene6005/lucene/analysis/common/src/test/org/apache/lucene/collation/TestCollationDocValuesField.java?rev=1635898&r1=1635897&r2=1635898&view=diff
==============================================================================
--- lucene/dev/branches/lucene6005/lucene/analysis/common/src/test/org/apache/lucene/collation/TestCollationDocValuesField.java (original)
+++ lucene/dev/branches/lucene6005/lucene/analysis/common/src/test/org/apache/lucene/collation/TestCollationDocValuesField.java Sat Nov  1 08:39:27 2014
@@ -123,7 +123,7 @@ public class TestCollationDocValuesField
     // positive test
     TopDocs docs = is.search(query, is.getIndexReader().maxDoc());
     for (ScoreDoc doc : docs.scoreDocs) {
-      String value = is.doc(doc.doc).get("field");
+      String value = is.doc(doc.doc).getString("field");
       assertTrue(collator.compare(value, startPoint) >= 0);
       assertTrue(collator.compare(value, endPoint) <= 0);
     }
@@ -134,7 +134,7 @@ public class TestCollationDocValuesField
     bq.add(query, Occur.MUST_NOT);
     docs = is.search(bq, is.getIndexReader().maxDoc());
     for (ScoreDoc doc : docs.scoreDocs) {
-      String value = is.doc(doc.doc).get("field");
+      String value = is.doc(doc.doc).getString("field");
       assertTrue(collator.compare(value, startPoint) < 0 || collator.compare(value, endPoint) > 0);
     }
   }

Modified: lucene/dev/branches/lucene6005/lucene/analysis/icu/src/test/org/apache/lucene/collation/TestICUCollationDocValuesField.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene6005/lucene/analysis/icu/src/test/org/apache/lucene/collation/TestICUCollationDocValuesField.java?rev=1635898&r1=1635897&r2=1635898&view=diff
==============================================================================
--- lucene/dev/branches/lucene6005/lucene/analysis/icu/src/test/org/apache/lucene/collation/TestICUCollationDocValuesField.java (original)
+++ lucene/dev/branches/lucene6005/lucene/analysis/icu/src/test/org/apache/lucene/collation/TestICUCollationDocValuesField.java Sat Nov  1 08:39:27 2014
@@ -123,7 +123,7 @@ public class TestICUCollationDocValuesFi
     // positive test
     TopDocs docs = is.search(query, is.getIndexReader().maxDoc());
     for (ScoreDoc doc : docs.scoreDocs) {
-      String value = is.doc(doc.doc).get("field");
+      String value = is.doc(doc.doc).getString("field");
       assertTrue(collator.compare(value, startPoint) >= 0);
       assertTrue(collator.compare(value, endPoint) <= 0);
     }
@@ -134,7 +134,7 @@ public class TestICUCollationDocValuesFi
     bq.add(query, Occur.MUST_NOT);
     docs = is.search(bq, is.getIndexReader().maxDoc());
     for (ScoreDoc doc : docs.scoreDocs) {
-      String value = is.doc(doc.doc).get("field");
+      String value = is.doc(doc.doc).getString("field");
       assertTrue(collator.compare(value, startPoint) < 0 || collator.compare(value, endPoint) > 0);
     }
   }

Modified: lucene/dev/branches/lucene6005/lucene/analysis/uima/src/test/org/apache/lucene/analysis/uima/UIMABaseAnalyzerTest.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene6005/lucene/analysis/uima/src/test/org/apache/lucene/analysis/uima/UIMABaseAnalyzerTest.java?rev=1635898&r1=1635897&r2=1635898&view=diff
==============================================================================
--- lucene/dev/branches/lucene6005/lucene/analysis/uima/src/test/org/apache/lucene/analysis/uima/UIMABaseAnalyzerTest.java (original)
+++ lucene/dev/branches/lucene6005/lucene/analysis/uima/src/test/org/apache/lucene/analysis/uima/UIMABaseAnalyzerTest.java Sat Nov  1 08:39:27 2014
@@ -17,15 +17,18 @@ package org.apache.lucene.analysis.uima;
  * limitations under the License.
  */
 
+import java.util.HashMap;
+import java.util.Map;
+
 import org.apache.lucene.analysis.BaseTokenStreamTestCase;
 import org.apache.lucene.analysis.TokenStream;
+import org.apache.lucene.document.Document2;
 import org.apache.lucene.document.Document;
 import org.apache.lucene.document.Field;
 import org.apache.lucene.document.TextField;
 import org.apache.lucene.index.DirectoryReader;
 import org.apache.lucene.index.IndexWriter;
 import org.apache.lucene.index.IndexWriterConfig;
-import org.apache.lucene.index.StoredDocument;
 import org.apache.lucene.search.IndexSearcher;
 import org.apache.lucene.search.MatchAllDocsQuery;
 import org.apache.lucene.search.TopDocs;
@@ -35,9 +38,6 @@ import org.junit.After;
 import org.junit.Before;
 import org.junit.Test;
 
-import java.util.HashMap;
-import java.util.Map;
-
 /**
  * Testcase for {@link UIMABaseAnalyzer}
  */
@@ -83,7 +83,7 @@ public class UIMABaseAnalyzerTest extend
     IndexSearcher indexSearcher = newSearcher(directoryReader);
     TopDocs result = indexSearcher.search(new MatchAllDocsQuery(), 1);
     assertTrue(result.totalHits > 0);
-    StoredDocument d = indexSearcher.doc(result.scoreDocs[0].doc);
+    Document2 d = indexSearcher.doc(result.scoreDocs[0].doc);
     assertNotNull(d);
     assertNotNull(d.getField("title"));
     assertEquals(dummyTitle, d.getField("title").stringValue());
@@ -103,7 +103,7 @@ public class UIMABaseAnalyzerTest extend
     directoryReader = DirectoryReader.open(dir);
     indexSearcher = newSearcher(directoryReader);
     result = indexSearcher.search(new MatchAllDocsQuery(), 2);
-    StoredDocument d1 = indexSearcher.doc(result.scoreDocs[1].doc);
+    Document2 d1 = indexSearcher.doc(result.scoreDocs[1].doc);
     assertNotNull(d1);
     assertNotNull(d1.getField("title"));
     assertEquals(dogmasTitle, d1.getField("title").stringValue());

Modified: lucene/dev/branches/lucene6005/lucene/backward-codecs/src/test/org/apache/lucene/index/TestBackwardsCompatibility.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene6005/lucene/backward-codecs/src/test/org/apache/lucene/index/TestBackwardsCompatibility.java?rev=1635898&r1=1635897&r2=1635898&view=diff
==============================================================================
--- lucene/dev/branches/lucene6005/lucene/backward-codecs/src/test/org/apache/lucene/index/TestBackwardsCompatibility.java (original)
+++ lucene/dev/branches/lucene6005/lucene/backward-codecs/src/test/org/apache/lucene/index/TestBackwardsCompatibility.java Sat Nov  1 08:39:27 2014
@@ -38,6 +38,7 @@ import java.util.regex.Pattern;
 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.DoubleDocValuesField;
 import org.apache.lucene.document.Field;
@@ -624,13 +625,13 @@ public class TestBackwardsCompatibility 
 
     for(int i=0;i<35;i++) {
       if (liveDocs.get(i)) {
-        StoredDocument d = reader.document(i);
-        List<StorableField> fields = d.getFields();
+        Document2 d = reader.document(i);
+        List<IndexableField> fields = d.getFields();
         boolean isProxDoc = d.getField("content3") == null;
         if (isProxDoc) {
           final int numFields = is40Index ? 7 : 5;
           assertEquals(numFields, fields.size());
-          StorableField f =  d.getField("id");
+          IndexableField f =  d.getField("id");
           assertEquals(""+i, f.stringValue());
 
           f = d.getField("utf8");
@@ -681,7 +682,7 @@ public class TestBackwardsCompatibility 
       }
       
       for (int i=0;i<35;i++) {
-        int id = Integer.parseInt(reader.document(i).get("id"));
+        int id = Integer.parseInt(reader.document(i).getString("id"));
         assertEquals(id, dvByte.get(i));
         
         byte bytes[] = new byte[] {
@@ -726,8 +727,8 @@ public class TestBackwardsCompatibility 
     ScoreDoc[] hits = searcher.search(new TermQuery(new Term(new String("content"), "aaa")), null, 1000).scoreDocs;
 
     // First document should be #0
-    StoredDocument d = searcher.getIndexReader().document(hits[0].doc);
-    assertEquals("didn't get the right document first", "0", d.get("id"));
+    Document2 d = searcher.getIndexReader().document(hits[0].doc);
+    assertEquals("didn't get the right document first", "0", d.getString("id"));
 
     doTestHits(hits, 34, searcher.getIndexReader());
     
@@ -770,8 +771,8 @@ public class TestBackwardsCompatibility 
     IndexReader reader = DirectoryReader.open(dir);
     IndexSearcher searcher = newSearcher(reader);
     ScoreDoc[] hits = searcher.search(new TermQuery(new Term("content", "aaa")), null, 1000).scoreDocs;
-    StoredDocument d = searcher.getIndexReader().document(hits[0].doc);
-    assertEquals("wrong first document", "0", d.get("id"));
+    Document2 d = searcher.getIndexReader().document(hits[0].doc);
+    assertEquals("wrong first document", "0", d.getString("id"));
     doTestHits(hits, 44, searcher.getIndexReader());
     reader.close();
 
@@ -798,8 +799,8 @@ public class TestBackwardsCompatibility 
     IndexSearcher searcher = newSearcher(reader);
     ScoreDoc[] hits = searcher.search(new TermQuery(new Term("content", "aaa")), null, 1000).scoreDocs;
     assertEquals("wrong number of hits", 34, hits.length);
-    StoredDocument d = searcher.doc(hits[0].doc);
-    assertEquals("wrong first document", "0", d.get("id"));
+    Document2 d = searcher.doc(hits[0].doc);
+    assertEquals("wrong first document", "0", d.getString("id"));
     reader.close();
 
     // fully merge
@@ -1039,13 +1040,13 @@ public class TestBackwardsCompatibility 
       for (int id=10; id<15; id++) {
         ScoreDoc[] hits = searcher.search(NumericRangeQuery.newIntRange("trieInt", NumericUtils.PRECISION_STEP_DEFAULT_32, Integer.valueOf(id), Integer.valueOf(id), true, true), 100).scoreDocs;
         assertEquals("wrong number of hits", 1, hits.length);
-        StoredDocument d = searcher.doc(hits[0].doc);
-        assertEquals(String.valueOf(id), d.get("id"));
+        Document2 d = searcher.doc(hits[0].doc);
+        assertEquals(String.valueOf(id), d.getString("id"));
         
         hits = searcher.search(NumericRangeQuery.newLongRange("trieLong", NumericUtils.PRECISION_STEP_DEFAULT, Long.valueOf(id), Long.valueOf(id), true, true), 100).scoreDocs;
         assertEquals("wrong number of hits", 1, hits.length);
         d = searcher.doc(hits[0].doc);
-        assertEquals(String.valueOf(id), d.get("id"));
+        assertEquals(String.valueOf(id), d.getString("id"));
       }
       
       // check that also lower-precision fields are ok

Modified: lucene/dev/branches/lucene6005/lucene/benchmark/src/java/org/apache/lucene/benchmark/byTask/tasks/BenchmarkHighlighter.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene6005/lucene/benchmark/src/java/org/apache/lucene/benchmark/byTask/tasks/BenchmarkHighlighter.java?rev=1635898&r1=1635897&r2=1635898&view=diff
==============================================================================
--- lucene/dev/branches/lucene6005/lucene/benchmark/src/java/org/apache/lucene/benchmark/byTask/tasks/BenchmarkHighlighter.java (original)
+++ lucene/dev/branches/lucene6005/lucene/benchmark/src/java/org/apache/lucene/benchmark/byTask/tasks/BenchmarkHighlighter.java Sat Nov  1 08:39:27 2014
@@ -18,14 +18,14 @@ package org.apache.lucene.benchmark.byTa
  */
 
 import org.apache.lucene.analysis.Analyzer;
+import org.apache.lucene.document.Document2;
 import org.apache.lucene.document.Document;
 import org.apache.lucene.index.IndexReader;
-import org.apache.lucene.index.StoredDocument;
 
 /**
  * Abstract class for benchmarking highlighting performance
  */
 public abstract class BenchmarkHighlighter {
-  public abstract int doHighlight( IndexReader reader, int doc, String field,
-      StoredDocument document, Analyzer analyzer, String text ) throws Exception ;
+  public abstract int doHighlight(IndexReader reader, int doc, String field,
+                                  Document2 document, Analyzer analyzer, String text) throws Exception;
 }

Modified: lucene/dev/branches/lucene6005/lucene/benchmark/src/java/org/apache/lucene/benchmark/byTask/tasks/ReadTask.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene6005/lucene/benchmark/src/java/org/apache/lucene/benchmark/byTask/tasks/ReadTask.java?rev=1635898&r1=1635897&r2=1635898&view=diff
==============================================================================
--- lucene/dev/branches/lucene6005/lucene/benchmark/src/java/org/apache/lucene/benchmark/byTask/tasks/ReadTask.java (original)
+++ lucene/dev/branches/lucene6005/lucene/benchmark/src/java/org/apache/lucene/benchmark/byTask/tasks/ReadTask.java Sat Nov  1 08:39:27 2014
@@ -20,29 +20,27 @@ package org.apache.lucene.benchmark.byTa
 import java.io.IOException;
 import java.util.Collection;
 import java.util.HashSet;
-
 import java.util.List;
 import java.util.Set;
 
 import org.apache.lucene.analysis.Analyzer;
 import org.apache.lucene.benchmark.byTask.PerfRunData;
 import org.apache.lucene.benchmark.byTask.feeds.QueryMaker;
+import org.apache.lucene.document.Document2;
 import org.apache.lucene.document.Document;
 import org.apache.lucene.index.DirectoryReader;
 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.search.Collector;
-import org.apache.lucene.search.TopDocs;
-import org.apache.lucene.search.MultiTermQuery;
-import org.apache.lucene.search.TopFieldCollector;
-import org.apache.lucene.search.ScoreDoc;
-import org.apache.lucene.search.TopScoreDocCollector;
 import org.apache.lucene.search.IndexSearcher;
+import org.apache.lucene.search.MultiTermQuery;
 import org.apache.lucene.search.Query;
+import org.apache.lucene.search.ScoreDoc;
 import org.apache.lucene.search.Sort;
+import org.apache.lucene.search.TopDocs;
+import org.apache.lucene.search.TopFieldCollector;
+import org.apache.lucene.search.TopScoreDocCollector;
 import org.apache.lucene.store.Directory;
 import org.apache.lucene.util.Bits;
 
@@ -98,7 +96,7 @@ public abstract class ReadTask extends P
 
     // optionally warm and add num docs traversed to count
     if (withWarm()) {
-      StoredDocument doc = null;
+      Document2 doc = null;
       Bits liveDocs = MultiFields.getLiveDocs(reader);
       for (int m = 0; m < reader.maxDoc(); m++) {
         if (null == liveDocs || liveDocs.get(m)) {
@@ -144,8 +142,8 @@ public abstract class ReadTask extends P
           System.out.println("numDocs() = " + reader.numDocs());
           for(int i=0;i<hits.scoreDocs.length;i++) {
             final int docID = hits.scoreDocs[i].doc;
-            final StoredDocument doc = reader.document(docID);
-            System.out.println("  " + i + ": doc=" + docID + " score=" + hits.scoreDocs[i].score + " " + printHitsField + " =" + doc.get(printHitsField));
+            final Document2 doc = reader.document(docID);
+            System.out.println("  " + i + ": doc=" + docID + " score=" + hits.scoreDocs[i].score + " " + printHitsField + " =" + doc.getString(printHitsField));
           }
         }
 
@@ -165,12 +163,12 @@ public abstract class ReadTask extends P
               int id = scoreDocs[m].doc;
               res++;
               if (retrieve) {
-                StoredDocument document = retrieveDoc(reader, id);
+                Document2 document = retrieveDoc(reader, id);
                 res += document != null ? 1 : 0;
                 if (numHighlight > 0 && m < numHighlight) {
                   Collection<String> fieldsToHighlight = getFieldsToHighlight(document);
                   for (final String field : fieldsToHighlight) {
-                    String text = document.get(field);
+                    String text = document.getString(field);
                     res += highlighter.doHighlight(reader, id, field, document, analyzer, text);
                   }
                 }
@@ -195,7 +193,7 @@ public abstract class ReadTask extends P
   }
 
 
-  protected StoredDocument retrieveDoc(IndexReader ir, int id) throws IOException {
+  protected Document2 retrieveDoc(IndexReader ir, int id) throws IOException {
     return ir.document(id);
   }
 
@@ -298,10 +296,10 @@ public abstract class ReadTask extends P
    * @param document The Document
    * @return A Collection of Field names (Strings)
    */
-  protected Collection<String> getFieldsToHighlight(StoredDocument document) {
-    List<StorableField> fields = document.getFields();
+  protected Collection<String> getFieldsToHighlight(Document2 document) {
+    List<IndexableField> fields = document.getFields();
     Set<String> result = new HashSet<>(fields.size());
-    for (final StorableField f : fields) {
+    for (final IndexableField f : fields) {
       result.add(f.name());
     }
     return result;

Modified: lucene/dev/branches/lucene6005/lucene/benchmark/src/java/org/apache/lucene/benchmark/byTask/tasks/ReadTokensTask.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene6005/lucene/benchmark/src/java/org/apache/lucene/benchmark/byTask/tasks/ReadTokensTask.java?rev=1635898&r1=1635897&r2=1635898&view=diff
==============================================================================
--- lucene/dev/branches/lucene6005/lucene/benchmark/src/java/org/apache/lucene/benchmark/byTask/tasks/ReadTokensTask.java (original)
+++ lucene/dev/branches/lucene6005/lucene/benchmark/src/java/org/apache/lucene/benchmark/byTask/tasks/ReadTokensTask.java Sat Nov  1 08:39:27 2014
@@ -26,11 +26,12 @@ import org.apache.lucene.analysis.tokena
 import org.apache.lucene.benchmark.byTask.PerfRunData;
 import org.apache.lucene.benchmark.byTask.feeds.DocMaker;
 import org.apache.lucene.document.Document;
+import org.apache.lucene.document.DoubleField;
 import org.apache.lucene.document.Field;
+import org.apache.lucene.document.FieldType;
+import org.apache.lucene.document.FloatField;
 import org.apache.lucene.document.IntField;
 import org.apache.lucene.document.LongField;
-import org.apache.lucene.document.FloatField;
-import org.apache.lucene.document.DoubleField;
 import org.apache.lucene.index.IndexableField;
 
 /**
@@ -69,11 +70,11 @@ public class ReadTokensTask extends Perf
 
   @Override
   public int doLogic() throws Exception {
-    List<Field> fields = doc.getFields();
+    List<IndexableField> fields = doc.getFields();
     Analyzer analyzer = getRunData().getAnalyzer();
     int tokenCount = 0;
-    for(final Field field : fields) {
-      if (!field.fieldType().tokenized() ||
+    for(final IndexableField field : fields) {
+      if (!((FieldType) field.fieldType()).tokenized() ||
           field instanceof IntField ||
           field instanceof LongField ||
           field instanceof FloatField ||

Modified: lucene/dev/branches/lucene6005/lucene/benchmark/src/java/org/apache/lucene/benchmark/byTask/tasks/SearchTravRetHighlightTask.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene6005/lucene/benchmark/src/java/org/apache/lucene/benchmark/byTask/tasks/SearchTravRetHighlightTask.java?rev=1635898&r1=1635897&r2=1635898&view=diff
==============================================================================
--- lucene/dev/branches/lucene6005/lucene/benchmark/src/java/org/apache/lucene/benchmark/byTask/tasks/SearchTravRetHighlightTask.java (original)
+++ lucene/dev/branches/lucene6005/lucene/benchmark/src/java/org/apache/lucene/benchmark/byTask/tasks/SearchTravRetHighlightTask.java Sat Nov  1 08:39:27 2014
@@ -17,12 +17,17 @@ package org.apache.lucene.benchmark.byTa
  * limitations under the License.
  */
 
+import java.util.Collection;
+import java.util.Collections;
+import java.util.HashSet;
+import java.util.Set;
+
 import org.apache.lucene.analysis.Analyzer;
 import org.apache.lucene.analysis.TokenStream;
 import org.apache.lucene.benchmark.byTask.PerfRunData;
+import org.apache.lucene.document.Document2;
 import org.apache.lucene.document.Document;
 import org.apache.lucene.index.IndexReader;
-import org.apache.lucene.index.StoredDocument;
 import org.apache.lucene.search.Query;
 import org.apache.lucene.search.highlight.Highlighter;
 import org.apache.lucene.search.highlight.QueryScorer;
@@ -30,11 +35,6 @@ import org.apache.lucene.search.highligh
 import org.apache.lucene.search.highlight.TextFragment;
 import org.apache.lucene.search.highlight.TokenSources;
 
-import java.util.Set;
-import java.util.Collection;
-import java.util.HashSet;
-import java.util.Collections;
-
 /**
  * Search and Traverse and Retrieve docs task.  Highlight the fields in the retrieved documents.
  *
@@ -102,7 +102,7 @@ public class SearchTravRetHighlightTask 
     return new BenchmarkHighlighter(){
       @Override
       public int doHighlight(IndexReader reader, int doc, String field,
-          StoredDocument document, Analyzer analyzer, String text) throws Exception {
+          Document2 document, Analyzer analyzer, String text) throws Exception {
         TokenStream ts = TokenSources.getAnyTokenStream(reader, doc, field, document, analyzer);
         TextFragment[] frag = highlighter.getBestTextFragments(ts, text, mergeContiguous, maxFrags);
         return frag != null ? frag.length : 0;
@@ -111,7 +111,7 @@ public class SearchTravRetHighlightTask 
   }
 
   @Override
-  protected Collection<String> getFieldsToHighlight(StoredDocument document) {
+  protected Collection<String> getFieldsToHighlight(Document2 document) {
     Collection<String> result = super.getFieldsToHighlight(document);
     //if stored is false, then result will be empty, in which case just get all the param fields
     if (paramFields.isEmpty() == false && result.isEmpty() == false) {
@@ -150,4 +150,4 @@ public class SearchTravRetHighlightTask 
   }
 
 
-}
\ No newline at end of file
+}

Modified: lucene/dev/branches/lucene6005/lucene/benchmark/src/java/org/apache/lucene/benchmark/byTask/tasks/SearchTravRetLoadFieldSelectorTask.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene6005/lucene/benchmark/src/java/org/apache/lucene/benchmark/byTask/tasks/SearchTravRetLoadFieldSelectorTask.java?rev=1635898&r1=1635897&r2=1635898&view=diff
==============================================================================
--- lucene/dev/branches/lucene6005/lucene/benchmark/src/java/org/apache/lucene/benchmark/byTask/tasks/SearchTravRetLoadFieldSelectorTask.java (original)
+++ lucene/dev/branches/lucene6005/lucene/benchmark/src/java/org/apache/lucene/benchmark/byTask/tasks/SearchTravRetLoadFieldSelectorTask.java Sat Nov  1 08:39:27 2014
@@ -22,10 +22,10 @@ import java.util.Set;
 import java.util.StringTokenizer;
 
 import org.apache.lucene.benchmark.byTask.PerfRunData;
+import org.apache.lucene.document.Document2;
+import org.apache.lucene.document.Document2StoredFieldVisitor;
 import org.apache.lucene.document.Document;
-import org.apache.lucene.document.DocumentStoredFieldVisitor;
 import org.apache.lucene.index.IndexReader;
-import org.apache.lucene.index.StoredDocument;
 
 /**
  * Search and Traverse and Retrieve docs task using a
@@ -55,11 +55,11 @@ public class SearchTravRetLoadFieldSelec
 
 
   @Override
-  protected StoredDocument retrieveDoc(IndexReader ir, int id) throws IOException {
+  protected Document2 retrieveDoc(IndexReader ir, int id) throws IOException {
     if (fieldsToLoad == null) {
       return ir.document(id);
     } else {
-      DocumentStoredFieldVisitor visitor = new DocumentStoredFieldVisitor(fieldsToLoad);
+      Document2StoredFieldVisitor visitor = new Document2StoredFieldVisitor(ir.getFieldTypes(), fieldsToLoad);
       ir.document(id, visitor);
       return visitor.getDocument();
     }

Modified: lucene/dev/branches/lucene6005/lucene/benchmark/src/java/org/apache/lucene/benchmark/byTask/tasks/SearchTravRetVectorHighlightTask.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene6005/lucene/benchmark/src/java/org/apache/lucene/benchmark/byTask/tasks/SearchTravRetVectorHighlightTask.java?rev=1635898&r1=1635897&r2=1635898&view=diff
==============================================================================
--- lucene/dev/branches/lucene6005/lucene/benchmark/src/java/org/apache/lucene/benchmark/byTask/tasks/SearchTravRetVectorHighlightTask.java (original)
+++ lucene/dev/branches/lucene6005/lucene/benchmark/src/java/org/apache/lucene/benchmark/byTask/tasks/SearchTravRetVectorHighlightTask.java Sat Nov  1 08:39:27 2014
@@ -17,20 +17,20 @@ package org.apache.lucene.benchmark.byTa
  * limitations under the License.
  */
 
+import java.util.Collection;
+import java.util.Collections;
+import java.util.HashSet;
+import java.util.Set;
+
 import org.apache.lucene.analysis.Analyzer;
 import org.apache.lucene.benchmark.byTask.PerfRunData;
+import org.apache.lucene.document.Document2;
 import org.apache.lucene.document.Document;
 import org.apache.lucene.index.IndexReader;
-import org.apache.lucene.index.StoredDocument;
 import org.apache.lucene.search.Query;
 import org.apache.lucene.search.vectorhighlight.FastVectorHighlighter;
 import org.apache.lucene.search.vectorhighlight.FieldQuery;
 
-import java.util.Set;
-import java.util.Collection;
-import java.util.HashSet;
-import java.util.Collections;
-
 /**
  * Search and Traverse and Retrieve docs task.  Highlight the fields in the retrieved documents by using FastVectorHighlighter.
  *
@@ -100,7 +100,7 @@ public class SearchTravRetVectorHighligh
     return new BenchmarkHighlighter(){
       @Override
       public int doHighlight(IndexReader reader, int doc, String field,
-          StoredDocument document, Analyzer analyzer, String text) throws Exception {
+          Document2 document, Analyzer analyzer, String text) throws Exception {
         final FieldQuery fq = highlighter.getFieldQuery( myq, reader);
         String[] fragments = highlighter.getBestFragments(fq, reader, doc, field, fragSize, maxFrags);
         return fragments != null ? fragments.length : 0;
@@ -109,7 +109,7 @@ public class SearchTravRetVectorHighligh
   }
 
   @Override
-  protected Collection<String> getFieldsToHighlight(StoredDocument document) {
+  protected Collection<String> getFieldsToHighlight(Document2 document) {
     Collection<String> result = super.getFieldsToHighlight(document);
     //if stored is false, then result will be empty, in which case just get all the param fields
     if (paramFields.isEmpty() == false && result.isEmpty() == false) {

Modified: lucene/dev/branches/lucene6005/lucene/benchmark/src/java/org/apache/lucene/benchmark/byTask/tasks/WriteEnwikiLineDocTask.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene6005/lucene/benchmark/src/java/org/apache/lucene/benchmark/byTask/tasks/WriteEnwikiLineDocTask.java?rev=1635898&r1=1635897&r2=1635898&view=diff
==============================================================================
--- lucene/dev/branches/lucene6005/lucene/benchmark/src/java/org/apache/lucene/benchmark/byTask/tasks/WriteEnwikiLineDocTask.java (original)
+++ lucene/dev/branches/lucene6005/lucene/benchmark/src/java/org/apache/lucene/benchmark/byTask/tasks/WriteEnwikiLineDocTask.java Sat Nov  1 08:39:27 2014
@@ -13,7 +13,7 @@ import org.apache.lucene.benchmark.byTas
 import org.apache.lucene.benchmark.byTask.feeds.DocMaker;
 import org.apache.lucene.benchmark.byTask.utils.StreamUtils;
 import org.apache.lucene.document.Document;
-import org.apache.lucene.index.StorableField;
+import org.apache.lucene.index.IndexableField;
 
 /*
  * Licensed to the Apache Software Foundation (ASF) under one or more
@@ -63,7 +63,7 @@ public class WriteEnwikiLineDocTask exte
   
   @Override
   protected PrintWriter lineFileOut(Document doc) {
-    StorableField titleField = doc.getField(DocMaker.TITLE_FIELD);
+    IndexableField titleField = doc.getField(DocMaker.TITLE_FIELD);
     if (titleField!=null && titleField.stringValue().startsWith("Category:")) {
       return categoryLineFileOut;
     }

Modified: lucene/dev/branches/lucene6005/lucene/benchmark/src/java/org/apache/lucene/benchmark/byTask/tasks/WriteLineDocTask.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene6005/lucene/benchmark/src/java/org/apache/lucene/benchmark/byTask/tasks/WriteLineDocTask.java?rev=1635898&r1=1635897&r2=1635898&view=diff
==============================================================================
--- lucene/dev/branches/lucene6005/lucene/benchmark/src/java/org/apache/lucene/benchmark/byTask/tasks/WriteLineDocTask.java (original)
+++ lucene/dev/branches/lucene6005/lucene/benchmark/src/java/org/apache/lucene/benchmark/byTask/tasks/WriteLineDocTask.java Sat Nov  1 08:39:27 2014
@@ -33,7 +33,7 @@ import org.apache.lucene.benchmark.byTas
 import org.apache.lucene.benchmark.byTask.utils.Config;
 import org.apache.lucene.benchmark.byTask.utils.StreamUtils;
 import org.apache.lucene.document.Document;
-import org.apache.lucene.index.StorableField;
+import org.apache.lucene.index.IndexableField;
 
 /**
  * A task which writes documents, one line per document. Each line is in the
@@ -175,7 +175,7 @@ public class WriteLineDocTask extends Pe
 
     boolean sufficient = !checkSufficientFields;
     for (int i=0; i<fieldsToWrite.length; i++) {
-      StorableField f = doc.getField(fieldsToWrite[i]);
+      IndexableField f = doc.getField(fieldsToWrite[i]);
       String text = f == null ? "" : matcher.reset(f.stringValue()).replaceAll(" ").trim();
       sb.append(text).append(SEP);
       sufficient |= text.length()>0 && sufficientFields[i];

Modified: lucene/dev/branches/lucene6005/lucene/benchmark/src/test/org/apache/lucene/benchmark/byTask/tasks/CountingHighlighterTestTask.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene6005/lucene/benchmark/src/test/org/apache/lucene/benchmark/byTask/tasks/CountingHighlighterTestTask.java?rev=1635898&r1=1635897&r2=1635898&view=diff
==============================================================================
--- lucene/dev/branches/lucene6005/lucene/benchmark/src/test/org/apache/lucene/benchmark/byTask/tasks/CountingHighlighterTestTask.java (original)
+++ lucene/dev/branches/lucene6005/lucene/benchmark/src/test/org/apache/lucene/benchmark/byTask/tasks/CountingHighlighterTestTask.java Sat Nov  1 08:39:27 2014
@@ -17,20 +17,20 @@
 
 package org.apache.lucene.benchmark.byTask.tasks;
 
-import org.apache.lucene.benchmark.byTask.PerfRunData;
-import org.apache.lucene.analysis.TokenStream;
+import java.io.IOException;
+
 import org.apache.lucene.analysis.Analyzer;
-import org.apache.lucene.search.highlight.SimpleHTMLFormatter;
+import org.apache.lucene.analysis.TokenStream;
+import org.apache.lucene.benchmark.byTask.PerfRunData;
+import org.apache.lucene.document.Document2;
+import org.apache.lucene.document.Document;
+import org.apache.lucene.index.IndexReader;
+import org.apache.lucene.search.Query;
 import org.apache.lucene.search.highlight.Highlighter;
-import org.apache.lucene.search.highlight.TextFragment;
 import org.apache.lucene.search.highlight.QueryScorer;
+import org.apache.lucene.search.highlight.SimpleHTMLFormatter;
+import org.apache.lucene.search.highlight.TextFragment;
 import org.apache.lucene.search.highlight.TokenSources;
-import org.apache.lucene.search.Query;
-import org.apache.lucene.document.Document;
-import org.apache.lucene.index.IndexReader;
-import org.apache.lucene.index.StoredDocument;
-
-import java.io.IOException;
 
 /**
  * Test Search task which counts number of searches.
@@ -45,8 +45,8 @@ public class CountingHighlighterTestTask
   }
 
   @Override
-  protected StoredDocument retrieveDoc(IndexReader ir, int id) throws IOException {
-    StoredDocument document = ir.document(id);
+  protected Document2 retrieveDoc(IndexReader ir, int id) throws IOException {
+    Document2 document = ir.document(id);
     if (document != null) {
       numDocsRetrieved++;
     }
@@ -58,7 +58,7 @@ public class CountingHighlighterTestTask
     highlighter = new Highlighter(new SimpleHTMLFormatter(), new QueryScorer(q));
     return new BenchmarkHighlighter() {
       @Override
-      public int doHighlight(IndexReader reader, int doc, String field, StoredDocument document, Analyzer analyzer, String text) throws Exception {
+      public int doHighlight(IndexReader reader, int doc, String field, Document2 document, Analyzer analyzer, String text) throws Exception {
         TokenStream ts = TokenSources.getAnyTokenStream(reader, doc, field, document, analyzer);
         TextFragment[] frag = highlighter.getBestTextFragments(ts, text, mergeContiguous, maxFrags);
         numHighlightedResults += frag != null ? frag.length : 0;

Modified: lucene/dev/branches/lucene6005/lucene/classification/src/java/org/apache/lucene/classification/BooleanPerceptronClassifier.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene6005/lucene/classification/src/java/org/apache/lucene/classification/BooleanPerceptronClassifier.java?rev=1635898&r1=1635897&r2=1635898&view=diff
==============================================================================
--- lucene/dev/branches/lucene6005/lucene/classification/src/java/org/apache/lucene/classification/BooleanPerceptronClassifier.java (original)
+++ lucene/dev/branches/lucene6005/lucene/classification/src/java/org/apache/lucene/classification/BooleanPerceptronClassifier.java Sat Nov  1 08:39:27 2014
@@ -16,13 +16,19 @@
  */
 package org.apache.lucene.classification;
 
+import java.io.IOException;
+import java.util.List;
+import java.util.Map;
+import java.util.SortedMap;
+import java.util.TreeMap;
+
 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.IndexableField;
 import org.apache.lucene.index.LeafReader;
 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;
@@ -40,12 +46,6 @@ import org.apache.lucene.util.fst.FST;
 import org.apache.lucene.util.fst.PositiveIntOutputs;
 import org.apache.lucene.util.fst.Util;
 
-import java.io.IOException;
-import java.util.List;
-import java.util.Map;
-import java.util.SortedMap;
-import java.util.TreeMap;
-
 /**
  * A perceptron (see <code>http://en.wikipedia.org/wiki/Perceptron</code>) based
  * <code>Boolean</code> {@link org.apache.lucene.classification.Classifier}. The
@@ -171,7 +171,7 @@ public class BooleanPerceptronClassifier
     // run the search and use stored field values
     for (ScoreDoc scoreDoc : indexSearcher.search(q,
         Integer.MAX_VALUE).scoreDocs) {
-      StoredDocument doc = indexSearcher.doc(scoreDoc.doc);
+      Document2 doc = indexSearcher.doc(scoreDoc.doc);
 
       // assign class to the doc
       ClassificationResult<Boolean> classificationResult = assignClass(doc
@@ -179,7 +179,7 @@ public class BooleanPerceptronClassifier
       Boolean assignedClass = classificationResult.getAssignedClass();
       
       // get the expected result
-      StorableField field = doc.getField(classFieldName);
+      IndexableField field = doc.getField(classFieldName);
       
       Boolean correctClass = Boolean.valueOf(field.stringValue());
       long modifier = correctClass.compareTo(assignedClass);
@@ -262,4 +262,4 @@ public class BooleanPerceptronClassifier
     return null;
   }
 
-}
\ No newline at end of file
+}

Modified: lucene/dev/branches/lucene6005/lucene/classification/src/java/org/apache/lucene/classification/utils/DatasetSplitter.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene6005/lucene/classification/src/java/org/apache/lucene/classification/utils/DatasetSplitter.java?rev=1635898&r1=1635897&r2=1635898&view=diff
==============================================================================
--- lucene/dev/branches/lucene6005/lucene/classification/src/java/org/apache/lucene/classification/utils/DatasetSplitter.java (original)
+++ lucene/dev/branches/lucene6005/lucene/classification/src/java/org/apache/lucene/classification/utils/DatasetSplitter.java Sat Nov  1 08:39:27 2014
@@ -17,23 +17,23 @@ package org.apache.lucene.classification
  * limitations under the License.
  */
 
+import java.io.IOException;
+
 import org.apache.lucene.analysis.Analyzer;
 import org.apache.lucene.document.Document;
 import org.apache.lucene.document.Field;
 import org.apache.lucene.document.FieldType;
 import org.apache.lucene.document.TextField;
-import org.apache.lucene.index.LeafReader;
 import org.apache.lucene.index.IndexWriter;
 import org.apache.lucene.index.IndexWriterConfig;
-import org.apache.lucene.index.StorableField;
+import org.apache.lucene.index.IndexableField;
+import org.apache.lucene.index.LeafReader;
 import org.apache.lucene.search.IndexSearcher;
 import org.apache.lucene.search.MatchAllDocsQuery;
 import org.apache.lucene.search.ScoreDoc;
 import org.apache.lucene.search.TopDocs;
 import org.apache.lucene.store.Directory;
 
-import java.io.IOException;
-
 /**
  * Utility class for creating training / test / cross validation indexes from the original index.
  */
@@ -96,7 +96,7 @@ public class DatasetSplitter {
             doc.add(new Field(fieldName, originalIndex.document(scoreDoc.doc).getField(fieldName).stringValue(), ft));
           }
         } else {
-          for (StorableField storableField : originalIndex.document(scoreDoc.doc).getFields()) {
+          for (IndexableField storableField : originalIndex.document(scoreDoc.doc).getFields()) {
             if (storableField.binaryValue() != null) {
               doc.add(new Field(storableField.name(), storableField.binaryValue(), ft));
             } else if (storableField.stringValue() != null) {

Modified: lucene/dev/branches/lucene6005/lucene/codecs/src/java/org/apache/lucene/codecs/simpletext/SimpleTextStoredFieldsWriter.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene6005/lucene/codecs/src/java/org/apache/lucene/codecs/simpletext/SimpleTextStoredFieldsWriter.java?rev=1635898&r1=1635897&r2=1635898&view=diff
==============================================================================
--- lucene/dev/branches/lucene6005/lucene/codecs/src/java/org/apache/lucene/codecs/simpletext/SimpleTextStoredFieldsWriter.java (original)
+++ lucene/dev/branches/lucene6005/lucene/codecs/src/java/org/apache/lucene/codecs/simpletext/SimpleTextStoredFieldsWriter.java Sat Nov  1 08:39:27 2014
@@ -23,7 +23,7 @@ import org.apache.lucene.codecs.StoredFi
 import org.apache.lucene.index.FieldInfo;
 import org.apache.lucene.index.FieldInfos;
 import org.apache.lucene.index.IndexFileNames;
-import org.apache.lucene.index.StorableField;
+import org.apache.lucene.index.IndexableField;
 import org.apache.lucene.store.Directory;
 import org.apache.lucene.store.IOContext;
 import org.apache.lucene.store.IndexOutput;
@@ -85,7 +85,7 @@ public class SimpleTextStoredFieldsWrite
   }
 
   @Override
-  public void writeField(FieldInfo info, StorableField field) throws IOException {
+  public void writeField(FieldInfo info, IndexableField field) throws IOException {
     write(FIELD);
     write(Integer.toString(info.number));
     newLine();

Modified: lucene/dev/branches/lucene6005/lucene/core/src/java/org/apache/lucene/codecs/StoredFieldsWriter.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene6005/lucene/core/src/java/org/apache/lucene/codecs/StoredFieldsWriter.java?rev=1635898&r1=1635897&r2=1635898&view=diff
==============================================================================
--- lucene/dev/branches/lucene6005/lucene/core/src/java/org/apache/lucene/codecs/StoredFieldsWriter.java (original)
+++ lucene/dev/branches/lucene6005/lucene/core/src/java/org/apache/lucene/codecs/StoredFieldsWriter.java Sat Nov  1 08:39:27 2014
@@ -19,12 +19,12 @@ package org.apache.lucene.codecs;
 import java.io.Closeable;
 import java.io.IOException;
 
-import org.apache.lucene.document.DocumentStoredFieldVisitor;
+import org.apache.lucene.document.Document2;
+import org.apache.lucene.document.Document2StoredFieldVisitor;
 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.StorableField;
-import org.apache.lucene.index.StoredDocument;
 import org.apache.lucene.util.Bits;
 
 /**
@@ -33,7 +33,7 @@ import org.apache.lucene.util.Bits;
  * <ol>
  *   <li>For every document, {@link #startDocument()} is called,
  *       informing the Codec that a new document has started.
- *   <li>{@link #writeField(FieldInfo, StorableField)} is called for 
+ *   <li>{@link #writeField(FieldInfo, IndexableField)} is called for 
  *       each field in the document.
  *   <li>After all documents have been written, {@link #finish(FieldInfos, int)} 
  *       is called for verification/sanity-checks.
@@ -59,7 +59,7 @@ public abstract class StoredFieldsWriter
   public void finishDocument() throws IOException {}
 
   /** Writes a single stored field. */
-  public abstract void writeField(FieldInfo info, StorableField field) throws IOException;
+  public abstract void writeField(FieldInfo info, IndexableField field) throws IOException;
 
   /** Aborts writing entirely, implementation should remove
    *  any partially-written files, etc. */
@@ -98,9 +98,9 @@ public abstract class StoredFieldsWriter
         // on the fly?
         // NOTE: it's very important to first assign to doc then pass it to
         // fieldsWriter.addDocument; see LUCENE-1282
-        DocumentStoredFieldVisitor visitor = new DocumentStoredFieldVisitor();
+        Document2StoredFieldVisitor visitor = new Document2StoredFieldVisitor(null);
         storedFieldsReader.visitDocument(docID, visitor);
-        StoredDocument doc = visitor.getDocument();
+        Document2 doc = visitor.getDocument();
         addDocument(doc, mergeState.mergeFieldInfos);
         docCount++;
         mergeState.checkAbort.work(300);
@@ -111,10 +111,10 @@ public abstract class StoredFieldsWriter
   }
   
   /** sugar method for startDocument() + writeField() for every stored field in the document */
-  protected final void addDocument(Iterable<? extends StorableField> doc, FieldInfos fieldInfos) throws IOException {
+  protected final void addDocument(Iterable<? extends IndexableField> doc, FieldInfos fieldInfos) throws IOException {
     startDocument();
 
-    for (StorableField field : doc) {
+    for (IndexableField field : doc) {
       writeField(fieldInfos.fieldInfo(field.name()), field);
     }
 

Modified: lucene/dev/branches/lucene6005/lucene/core/src/java/org/apache/lucene/codecs/compressing/CompressingStoredFieldsWriter.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene6005/lucene/core/src/java/org/apache/lucene/codecs/compressing/CompressingStoredFieldsWriter.java?rev=1635898&r1=1635897&r2=1635898&view=diff
==============================================================================
--- lucene/dev/branches/lucene6005/lucene/core/src/java/org/apache/lucene/codecs/compressing/CompressingStoredFieldsWriter.java (original)
+++ lucene/dev/branches/lucene6005/lucene/core/src/java/org/apache/lucene/codecs/compressing/CompressingStoredFieldsWriter.java Sat Nov  1 08:39:27 2014
@@ -24,14 +24,14 @@ import org.apache.lucene.codecs.CodecUti
 import org.apache.lucene.codecs.StoredFieldsReader;
 import org.apache.lucene.codecs.StoredFieldsWriter;
 import org.apache.lucene.codecs.compressing.CompressingStoredFieldsReader.ChunkIterator;
-import org.apache.lucene.document.DocumentStoredFieldVisitor;
+import org.apache.lucene.document.Document2StoredFieldVisitor;
 import org.apache.lucene.index.CorruptIndexException;
 import org.apache.lucene.index.FieldInfo;
 import org.apache.lucene.index.FieldInfos;
 import org.apache.lucene.index.IndexFileNames;
+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.DataOutput;
 import org.apache.lucene.store.Directory;
 import org.apache.lucene.store.IOContext;
@@ -242,7 +242,7 @@ public final class CompressingStoredFiel
   }
 
   @Override
-  public void writeField(FieldInfo info, StorableField field)
+  public void writeField(FieldInfo info, IndexableField field)
       throws IOException {
 
     ++numStoredFieldsInDoc;
@@ -356,7 +356,7 @@ public final class CompressingStoredFiel
           storedFieldsReader.checkIntegrity();
         }
         for (int i = nextLiveDoc(0, liveDocs, maxDoc); i < maxDoc; i = nextLiveDoc(i + 1, liveDocs, maxDoc)) {
-          DocumentStoredFieldVisitor visitor = new DocumentStoredFieldVisitor();
+          Document2StoredFieldVisitor visitor = new Document2StoredFieldVisitor(mergeState.fieldTypes);
           storedFieldsReader.visitDocument(i, visitor);
           addDocument(visitor.getDocument(), mergeState.mergeFieldInfos);
           ++docCount;

Modified: lucene/dev/branches/lucene6005/lucene/core/src/java/org/apache/lucene/document/Document.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene6005/lucene/core/src/java/org/apache/lucene/document/Document.java?rev=1635898&r1=1635897&r2=1635898&view=diff
==============================================================================
--- lucene/dev/branches/lucene6005/lucene/core/src/java/org/apache/lucene/document/Document.java (original)
+++ lucene/dev/branches/lucene6005/lucene/core/src/java/org/apache/lucene/document/Document.java Sat Nov  1 08:39:27 2014
@@ -19,11 +19,8 @@ package org.apache.lucene.document;
 
 import java.util.*;
 
-import org.apache.lucene.index.IndexDocument;
 import org.apache.lucene.index.IndexReader;  // for javadoc
 import org.apache.lucene.index.IndexableField;
-import org.apache.lucene.index.StorableField;
-import org.apache.lucene.index.StoredDocument;
 import org.apache.lucene.search.IndexSearcher;  // for javadoc
 import org.apache.lucene.search.ScoreDoc; // for javadoc
 import org.apache.lucene.util.BytesRef;
@@ -42,37 +39,15 @@ import org.apache.lucene.util.FilterIter
  * ScoreDoc#doc} or {@link IndexReader#document(int)}.
  */
 
-public final class Document implements IndexDocument {
+public final class Document implements Iterable<IndexableField> {
 
-  private final List<Field> fields = new ArrayList<>();
+  private final List<IndexableField> fields = new ArrayList<>();
 
   /** Constructs a new document with no fields. */
   public Document() {}
   
 
   /**
-  * Creates a Document from StoredDocument so it that can be used e.g. for another
-  * round of indexing.
-  *
-  */
-  public Document(StoredDocument storedDoc) {
-    for (StorableField field : storedDoc.getFields()) {
-      Field newField = new Field(field.name(), (FieldType) field.fieldType());
-     
-      newField.fieldsData = field.stringValue();
-      if (newField.fieldsData == null) {
-        newField.fieldsData = field.numericValue();
-      }
-      if (newField.fieldsData == null) {
-        newField.fieldsData = field.binaryValue();
-      }
-     
-      add(newField);
-    }
-  }
-
-  
-  /**
    * <p>Adds a field to a document.  Several fields may be added with
    * the same name.  In this case, if the fields are indexed, their text is
    * treated as though appended for the purposes of search.</p>
@@ -82,7 +57,7 @@ public final class Document implements I
    * a document has to be deleted from an index and a new changed version of that
    * document has to be added.</p>
    */
-  public final void add(Field field) {
+  public final void add(IndexableField field) {
     fields.add(field);
   }
   
@@ -97,9 +72,9 @@ public final class Document implements I
    * document has to be added.</p>
    */
   public final void removeField(String name) {
-    Iterator<Field> it = fields.iterator();
+    Iterator<IndexableField> it = fields.iterator();
     while (it.hasNext()) {
-      Field field = it.next();
+      IndexableField field = it.next();
       if (field.name().equals(name)) {
         it.remove();
         return;
@@ -117,9 +92,9 @@ public final class Document implements I
    * document has to be added.</p>
    */
   public final void removeFields(String name) {
-    Iterator<Field> it = fields.iterator();
+    Iterator<IndexableField> it = fields.iterator();
     while (it.hasNext()) {
-      Field field = it.next();
+      IndexableField field = it.next();
       if (field.name().equals(name)) {
         it.remove();
       }
@@ -139,8 +114,8 @@ public final class Document implements I
   public final BytesRef[] getBinaryValues(String name) {
     final List<BytesRef> result = new ArrayList<>();
 
-    for (Iterator<StorableField> it = storedFieldsIterator(); it.hasNext(); ) {
-      StorableField field = it.next();
+    for (Iterator<IndexableField> it = storedFieldsIterator(); it.hasNext(); ) {
+      IndexableField field = it.next();
       if (field.name().equals(name)) {
         final BytesRef bytes = field.binaryValue();
         if (bytes != null) {
@@ -162,8 +137,8 @@ public final class Document implements I
   * @return a <code>BytesRef</code> containing the binary field value or <code>null</code>
   */
   public final BytesRef getBinaryValue(String name) {
-    for (Iterator<StorableField> it = storedFieldsIterator(); it.hasNext(); ) {
-      StorableField field = it.next();
+    for (Iterator<IndexableField> it = storedFieldsIterator(); it.hasNext(); ) {
+      IndexableField field = it.next();
       if (field.name().equals(name)) {
         final BytesRef bytes = field.binaryValue();
         if (bytes != null) {
@@ -178,8 +153,8 @@ public final class Document implements I
    * null.  If multiple fields exists with this name, this method returns the
    * first value added.
    */
-  public final Field getField(String name) {
-    for (Field field : fields) {
+  public final IndexableField getField(String name) {
+    for (IndexableField field : fields) {
       if (field.name().equals(name)) {
         return field;
       }
@@ -195,15 +170,15 @@ public final class Document implements I
    * @param name the name of the field
    * @return a <code>Field[]</code> array
    */
-  public Field[] getFields(String name) {
-    List<Field> result = new ArrayList<>();
-    for (Field field : fields) {
+  public IndexableField[] getFields(String name) {
+    List<IndexableField> result = new ArrayList<>();
+    for (IndexableField field : fields) {
       if (field.name().equals(name)) {
         result.add(field);
       }
     }
 
-    return result.toArray(new Field[result.size()]);
+    return result.toArray(new IndexableField[result.size()]);
   }
   
   /** Returns a List of all the fields in a document.
@@ -212,9 +187,9 @@ public final class Document implements I
    * index, e.g. {@link IndexSearcher#doc(int)} or {@link
    * IndexReader#document(int)}.
    * 
-   * @return an immutable <code>List&lt;Field&gt;</code> 
+   * @return an immutable <code>List&lt;IndexableField&gt;</code> 
    */
-  public final List<Field> getFields() {
+  public final List<IndexableField> getFields() {
     return Collections.unmodifiableList(fields);
   }
   
@@ -233,8 +208,8 @@ public final class Document implements I
   public final String[] getValues(String name) {
     List<String> result = new ArrayList<>();
 
-    for (Iterator<StorableField> it = storedFieldsIterator(); it.hasNext(); ) {
-      StorableField field = it.next();
+    for (Iterator<IndexableField> it = storedFieldsIterator(); it.hasNext(); ) {
+      IndexableField field = it.next();
       if (field.name().equals(name) && field.stringValue() != null) {
         result.add(field.stringValue());
       }
@@ -256,8 +231,8 @@ public final class Document implements I
    * the actual numeric field instance back, use {@link #getField}.
    */
   public final String get(String name) {
-    for (Iterator<StorableField> it = storedFieldsIterator(); it.hasNext(); ) {
-      StorableField field = it.next();
+    for (Iterator<IndexableField> it = storedFieldsIterator(); it.hasNext(); ) {
+      IndexableField field = it.next();
       if (field.name().equals(name) && field.stringValue() != null) {
         return field.stringValue();
       }
@@ -283,40 +258,19 @@ public final class Document implements I
 
   /** Obtains all indexed fields in document */
   @Override
-  public Iterable<IndexableField> indexableFields() {
-    return new Iterable<IndexableField>() {
-      @Override
-      public Iterator<IndexableField> iterator() {
-        return Document.this.indexedFieldsIterator();
-      }
-    };
+  public Iterator<IndexableField> iterator() {
+    // nocommit how to fix generics here so I can just return fields.iterator?
+    //return fields.iterator();
+    ArrayList<IndexableField> l = new ArrayList<>();
+    l.addAll(fields);
+    return l.iterator();
   }
 
-  /** Obtains all stored fields in document. */
-  @Override
-  public Iterable<StorableField> storableFields() {
-    return new Iterable<StorableField>() {
-      @Override
-      public Iterator<StorableField> iterator() {
-        return Document.this.storedFieldsIterator();
-      }
-    };
-  }
-
-  private Iterator<StorableField> storedFieldsIterator() {
-    return new FilterIterator<StorableField, Field>(fields.iterator()) {
-      @Override
-      protected boolean predicateFunction(Field field) {
-        return field.type.stored() || field.type.docValueType() != null;
-      }
-    };
-  }
-  
-  private Iterator<IndexableField> indexedFieldsIterator() {
-    return new FilterIterator<IndexableField, Field>(fields.iterator()) {
+  private Iterator<IndexableField> storedFieldsIterator() {
+    return new FilterIterator<IndexableField,IndexableField>(iterator()) {
       @Override
-      protected boolean predicateFunction(Field field) {
-        return field.type.indexOptions() != null;
+      protected boolean predicateFunction(IndexableField field) {
+        return field.fieldType().stored() || field.fieldType().docValueType() != null;
       }
     };
   }



Mime
View raw message