lucene-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mikemcc...@apache.org
Subject svn commit: r1348639 [7/8] - in /lucene/dev/branches/branch_4x: ./ lucene/ lucene/analysis/ lucene/analysis/common/ lucene/analysis/common/src/test/org/apache/lucene/analysis/core/ lucene/analysis/common/src/test/org/apache/lucene/analysis/miscellaneou...
Date Sun, 10 Jun 2012 18:27:17 GMT
Modified: lucene/dev/branches/branch_4x/lucene/join/src/test/org/apache/lucene/search/join/TestJoinUtil.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/branch_4x/lucene/join/src/test/org/apache/lucene/search/join/TestJoinUtil.java?rev=1348639&r1=1348638&r2=1348639&view=diff
==============================================================================
--- lucene/dev/branches/branch_4x/lucene/join/src/test/org/apache/lucene/search/join/TestJoinUtil.java (original)
+++ lucene/dev/branches/branch_4x/lucene/join/src/test/org/apache/lucene/search/join/TestJoinUtil.java Sun Jun 10 18:27:08 2012
@@ -67,45 +67,45 @@ public class TestJoinUtil extends Lucene
 
     // 0
     Document doc = new Document();
-    doc.add(new Field("description", "random text", TextField.TYPE_UNSTORED));
-    doc.add(new Field("name", "name1", TextField.TYPE_UNSTORED));
-    doc.add(new Field(idField, "1", TextField.TYPE_UNSTORED));
+    doc.add(new TextField("description", "random text", Field.Store.NO));
+    doc.add(new TextField("name", "name1", Field.Store.NO));
+    doc.add(new TextField(idField, "1", Field.Store.NO));
     w.addDocument(doc);
 
     // 1
     doc = new Document();
-    doc.add(new Field("price", "10.0", TextField.TYPE_UNSTORED));
-    doc.add(new Field(idField, "2", TextField.TYPE_UNSTORED));
-    doc.add(new Field(toField, "1", TextField.TYPE_UNSTORED));
+    doc.add(new TextField("price", "10.0", Field.Store.NO));
+    doc.add(new TextField(idField, "2", Field.Store.NO));
+    doc.add(new TextField(toField, "1", Field.Store.NO));
     w.addDocument(doc);
 
     // 2
     doc = new Document();
-    doc.add(new Field("price", "20.0", TextField.TYPE_UNSTORED));
-    doc.add(new Field(idField, "3", TextField.TYPE_UNSTORED));
-    doc.add(new Field(toField, "1", TextField.TYPE_UNSTORED));
+    doc.add(new TextField("price", "20.0", Field.Store.NO));
+    doc.add(new TextField(idField, "3", Field.Store.NO));
+    doc.add(new TextField(toField, "1", Field.Store.NO));
     w.addDocument(doc);
 
     // 3
     doc = new Document();
-    doc.add(new Field("description", "more random text", TextField.TYPE_UNSTORED));
-    doc.add(new Field("name", "name2", TextField.TYPE_UNSTORED));
-    doc.add(new Field(idField, "4", TextField.TYPE_UNSTORED));
+    doc.add(new TextField("description", "more random text", Field.Store.NO));
+    doc.add(new TextField("name", "name2", Field.Store.NO));
+    doc.add(new TextField(idField, "4", Field.Store.NO));
     w.addDocument(doc);
     w.commit();
 
     // 4
     doc = new Document();
-    doc.add(new Field("price", "10.0", TextField.TYPE_UNSTORED));
-    doc.add(new Field(idField, "5", TextField.TYPE_UNSTORED));
-    doc.add(new Field(toField, "4", TextField.TYPE_UNSTORED));
+    doc.add(new TextField("price", "10.0", Field.Store.NO));
+    doc.add(new TextField(idField, "5", Field.Store.NO));
+    doc.add(new TextField(toField, "4", Field.Store.NO));
     w.addDocument(doc);
 
     // 5
     doc = new Document();
-    doc.add(new Field("price", "20.0", TextField.TYPE_UNSTORED));
-    doc.add(new Field(idField, "6", TextField.TYPE_UNSTORED));
-    doc.add(new Field(toField, "4", TextField.TYPE_UNSTORED));
+    doc.add(new TextField("price", "20.0", Field.Store.NO));
+    doc.add(new TextField(idField, "6", Field.Store.NO));
+    doc.add(new TextField(toField, "4", Field.Store.NO));
     w.addDocument(doc);
 
     IndexSearcher indexSearcher = new IndexSearcher(w.getReader());
@@ -149,45 +149,45 @@ public class TestJoinUtil extends Lucene
 
     // 0
     Document doc = new Document();
-    doc.add(new Field("description", "A random movie", TextField.TYPE_UNSTORED));
-    doc.add(new Field("name", "Movie 1", TextField.TYPE_UNSTORED));
-    doc.add(new Field(idField, "1", TextField.TYPE_UNSTORED));
+    doc.add(new TextField("description", "A random movie", Field.Store.NO));
+    doc.add(new TextField("name", "Movie 1", Field.Store.NO));
+    doc.add(new TextField(idField, "1", Field.Store.NO));
     w.addDocument(doc);
 
     // 1
     doc = new Document();
-    doc.add(new Field("subtitle", "The first subtitle of this movie", TextField.TYPE_UNSTORED));
-    doc.add(new Field(idField, "2", TextField.TYPE_UNSTORED));
-    doc.add(new Field(toField, "1", TextField.TYPE_UNSTORED));
+    doc.add(new TextField("subtitle", "The first subtitle of this movie", Field.Store.NO));
+    doc.add(new TextField(idField, "2", Field.Store.NO));
+    doc.add(new TextField(toField, "1", Field.Store.NO));
     w.addDocument(doc);
 
     // 2
     doc = new Document();
-    doc.add(new Field("subtitle", "random subtitle; random event movie", TextField.TYPE_UNSTORED));
-    doc.add(new Field(idField, "3", TextField.TYPE_UNSTORED));
-    doc.add(new Field(toField, "1", TextField.TYPE_UNSTORED));
+    doc.add(new TextField("subtitle", "random subtitle; random event movie", Field.Store.NO));
+    doc.add(new TextField(idField, "3", Field.Store.NO));
+    doc.add(new TextField(toField, "1", Field.Store.NO));
     w.addDocument(doc);
 
     // 3
     doc = new Document();
-    doc.add(new Field("description", "A second random movie", TextField.TYPE_UNSTORED));
-    doc.add(new Field("name", "Movie 2", TextField.TYPE_UNSTORED));
-    doc.add(new Field(idField, "4", TextField.TYPE_UNSTORED));
+    doc.add(new TextField("description", "A second random movie", Field.Store.NO));
+    doc.add(new TextField("name", "Movie 2", Field.Store.NO));
+    doc.add(new TextField(idField, "4", Field.Store.NO));
     w.addDocument(doc);
     w.commit();
 
     // 4
     doc = new Document();
-    doc.add(new Field("subtitle", "a very random event happened during christmas night", TextField.TYPE_UNSTORED));
-    doc.add(new Field(idField, "5", TextField.TYPE_UNSTORED));
-    doc.add(new Field(toField, "4", TextField.TYPE_UNSTORED));
+    doc.add(new TextField("subtitle", "a very random event happened during christmas night", Field.Store.NO));
+    doc.add(new TextField(idField, "5", Field.Store.NO));
+    doc.add(new TextField(toField, "4", Field.Store.NO));
     w.addDocument(doc);
 
     // 5
     doc = new Document();
-    doc.add(new Field("subtitle", "movie end movie test 123 test 123 random", TextField.TYPE_UNSTORED));
-    doc.add(new Field(idField, "6", TextField.TYPE_UNSTORED));
-    doc.add(new Field(toField, "4", TextField.TYPE_UNSTORED));
+    doc.add(new TextField("subtitle", "movie end movie test 123 test 123 random", Field.Store.NO));
+    doc.add(new TextField(idField, "6", Field.Store.NO));
+    doc.add(new TextField(toField, "4", Field.Store.NO));
     w.addDocument(doc);
 
     IndexSearcher indexSearcher = new IndexSearcher(w.getReader());
@@ -381,8 +381,8 @@ public class TestJoinUtil extends Lucene
       int randomI = random().nextInt(context.randomUniqueValues.length);
       String value = context.randomUniqueValues[randomI];
       Document document = new Document();
-      document.add(newField(random(), "id", id, TextField.TYPE_UNSTORED));
-      document.add(newField(random(), "value", value, TextField.TYPE_UNSTORED));
+      document.add(newTextField(random(), "id", id, Field.Store.NO));
+      document.add(newTextField(random(), "value", value, Field.Store.NO));
 
       boolean from = context.randomFrom[randomI];
       int numberOfLinkValues = multipleValuesPerDocument ? 2 + random().nextInt(10) : 1;
@@ -400,7 +400,7 @@ public class TestJoinUtil extends Lucene
 
           context.fromDocuments.get(linkValue).add(docs[i]);
           context.randomValueFromDocs.get(value).add(docs[i]);
-          document.add(newField(random(), "from", linkValue, TextField.TYPE_UNSTORED));
+          document.add(newTextField(random(), "from", linkValue, Field.Store.NO));
         } else {
           if (!context.toDocuments.containsKey(linkValue)) {
             context.toDocuments.put(linkValue, new ArrayList<RandomDoc>());
@@ -411,7 +411,7 @@ public class TestJoinUtil extends Lucene
 
           context.toDocuments.get(linkValue).add(docs[i]);
           context.randomValueToDocs.get(value).add(docs[i]);
-          document.add(newField(random(), "to", linkValue, TextField.TYPE_UNSTORED));
+          document.add(newTextField(random(), "to", linkValue, Field.Store.NO));
         }
       }
 

Modified: lucene/dev/branches/branch_4x/lucene/memory/src/test/org/apache/lucene/index/memory/MemoryIndexTest.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/branch_4x/lucene/memory/src/test/org/apache/lucene/index/memory/MemoryIndexTest.java?rev=1348639&r1=1348638&r2=1348639&view=diff
==============================================================================
--- lucene/dev/branches/branch_4x/lucene/memory/src/test/org/apache/lucene/index/memory/MemoryIndexTest.java (original)
+++ lucene/dev/branches/branch_4x/lucene/memory/src/test/org/apache/lucene/index/memory/MemoryIndexTest.java Sun Jun 10 18:27:08 2012
@@ -33,7 +33,6 @@ import org.apache.lucene.analysis.MockTo
 import org.apache.lucene.codecs.lucene40.Lucene40PostingsFormat;
 import org.apache.lucene.document.Document;
 import org.apache.lucene.document.Field;
-import org.apache.lucene.document.TextField;
 import org.apache.lucene.index.AtomicReader;
 import org.apache.lucene.index.DirectoryReader;
 import org.apache.lucene.index.DocsAndPositionsEnum;
@@ -126,8 +125,8 @@ public class MemoryIndexTest extends Bas
     IndexWriter writer = new IndexWriter(ramdir,
                                          new IndexWriterConfig(TEST_VERSION_CURRENT, analyzer).setCodec(_TestUtil.alwaysPostingsFormat(new Lucene40PostingsFormat())));
     Document doc = new Document();
-    Field field1 = newField("foo", fooField.toString(), TextField.TYPE_UNSTORED);
-    Field field2 = newField("term", termField.toString(), TextField.TYPE_UNSTORED);
+    Field field1 = newTextField("foo", fooField.toString(), Field.Store.NO);
+    Field field2 = newTextField("term", termField.toString(), Field.Store.NO);
     doc.add(field1);
     doc.add(field2);
     writer.addDocument(doc);

Modified: lucene/dev/branches/branch_4x/lucene/misc/src/test/org/apache/lucene/index/TestMultiPassIndexSplitter.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/branch_4x/lucene/misc/src/test/org/apache/lucene/index/TestMultiPassIndexSplitter.java?rev=1348639&r1=1348638&r2=1348639&view=diff
==============================================================================
--- lucene/dev/branches/branch_4x/lucene/misc/src/test/org/apache/lucene/index/TestMultiPassIndexSplitter.java (original)
+++ lucene/dev/branches/branch_4x/lucene/misc/src/test/org/apache/lucene/index/TestMultiPassIndexSplitter.java Sun Jun 10 18:27:08 2012
@@ -18,8 +18,7 @@ package org.apache.lucene.index;
 
 import org.apache.lucene.analysis.MockAnalyzer;
 import org.apache.lucene.document.Document;
-import org.apache.lucene.document.StringField;
-import org.apache.lucene.document.TextField;
+import org.apache.lucene.document.Field;
 import org.apache.lucene.store.Directory;
 import org.apache.lucene.util.BytesRef;
 import org.apache.lucene.util.LuceneTestCase;
@@ -37,8 +36,8 @@ public class TestMultiPassIndexSplitter 
     Document doc;
     for (int i = 0; i < NUM_DOCS; i++) {
       doc = new Document();
-      doc.add(newField("id", i + "", StringField.TYPE_STORED));
-      doc.add(newField("f", i + " " + i, TextField.TYPE_STORED));
+      doc.add(newStringField("id", i + "", Field.Store.YES));
+      doc.add(newTextField("f", i + " " + i, Field.Store.YES));
       w.addDocument(doc);
       if (i%3==0) w.commit();
     }

Modified: lucene/dev/branches/branch_4x/lucene/misc/src/test/org/apache/lucene/index/TestPKIndexSplitter.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/branch_4x/lucene/misc/src/test/org/apache/lucene/index/TestPKIndexSplitter.java?rev=1348639&r1=1348638&r2=1348639&view=diff
==============================================================================
--- lucene/dev/branches/branch_4x/lucene/misc/src/test/org/apache/lucene/index/TestPKIndexSplitter.java (original)
+++ lucene/dev/branches/branch_4x/lucene/misc/src/test/org/apache/lucene/index/TestPKIndexSplitter.java Sun Jun 10 18:27:08 2012
@@ -23,8 +23,7 @@ import java.text.NumberFormat;
 import org.apache.lucene.analysis.MockAnalyzer;
 import org.apache.lucene.analysis.MockTokenizer;
 import org.apache.lucene.document.Document;
-import org.apache.lucene.document.StringField;
-import org.apache.lucene.document.TextField;
+import org.apache.lucene.document.Field;
 import org.apache.lucene.index.IndexWriterConfig.OpenMode;
 import org.apache.lucene.store.Directory;
 import org.apache.lucene.util.Bits;
@@ -104,15 +103,15 @@ public class TestPKIndexSplitter extends
     StringBuilder sb = new StringBuilder();
     Document doc = new Document();
     String id = format.format(n);
-    doc.add(newField("id", id, StringField.TYPE_STORED));
-    doc.add(newField("indexname", indexName, StringField.TYPE_STORED));
+    doc.add(newStringField("id", id, Field.Store.YES));
+    doc.add(newStringField("indexname", indexName, Field.Store.YES));
     sb.append("a");
     sb.append(n);
-    doc.add(newField("field1", sb.toString(), TextField.TYPE_STORED));
+    doc.add(newTextField("field1", sb.toString(), Field.Store.YES));
     sb.append(" b");
     sb.append(n);
     for (int i = 1; i < numFields; i++) {
-      doc.add(newField("field" + (i + 1), sb.toString(), TextField.TYPE_STORED));
+      doc.add(newTextField("field" + (i + 1), sb.toString(), Field.Store.YES));
     }
     return doc;
   }

Modified: lucene/dev/branches/branch_4x/lucene/misc/src/test/org/apache/lucene/misc/TestHighFreqTerms.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/branch_4x/lucene/misc/src/test/org/apache/lucene/misc/TestHighFreqTerms.java?rev=1348639&r1=1348638&r2=1348639&view=diff
==============================================================================
--- lucene/dev/branches/branch_4x/lucene/misc/src/test/org/apache/lucene/misc/TestHighFreqTerms.java (original)
+++ lucene/dev/branches/branch_4x/lucene/misc/src/test/org/apache/lucene/misc/TestHighFreqTerms.java Sun Jun 10 18:27:08 2012
@@ -22,7 +22,7 @@ import java.util.Random;
 import org.apache.lucene.analysis.MockAnalyzer;
 import org.apache.lucene.analysis.MockTokenizer;
 import org.apache.lucene.document.Document;
-import org.apache.lucene.document.TextField;
+import org.apache.lucene.document.Field;
 import org.apache.lucene.index.DirectoryReader;
 import org.apache.lucene.index.IndexReader;
 import org.apache.lucene.index.IndexWriter;
@@ -206,9 +206,9 @@ public class TestHighFreqTerms extends L
       Document doc = new Document();
       String content = getContent(i);
     
-      doc.add(newField(rnd, "FIELD_1", content, TextField.TYPE_STORED));
+      doc.add(newTextField(rnd, "FIELD_1", content, Field.Store.YES));
       //add a different field
-      doc.add(newField(rnd, "different_field", "diff", TextField.TYPE_STORED));
+      doc.add(newTextField(rnd, "different_field", "diff", Field.Store.YES));
       writer.addDocument(doc);
     }
     
@@ -216,7 +216,7 @@ public class TestHighFreqTerms extends L
     //highest freq terms for a specific field.
     for (int i = 1; i <= 10; i++) {
       Document doc = new Document();
-      doc.add(newField(rnd, "different_field", "diff", TextField.TYPE_STORED));
+      doc.add(newTextField(rnd, "different_field", "diff", Field.Store.YES));
       writer.addDocument(doc);
     }
     // add some docs where tf < df so we can see if sorting works
@@ -227,7 +227,7 @@ public class TestHighFreqTerms extends L
     for (int i = 0; i < highTF; i++) {
       content += "highTF ";
     }
-    doc.add(newField(rnd, "FIELD_1", content, TextField.TYPE_STORED));
+    doc.add(newTextField(rnd, "FIELD_1", content, Field.Store.YES));
     writer.addDocument(doc);
     // highTF medium df =5
     int medium_df = 5;
@@ -238,7 +238,7 @@ public class TestHighFreqTerms extends L
       for (int j = 0; j < tf; j++) {
         newcontent += "highTFmedDF ";
       }
-      newdoc.add(newField(rnd, "FIELD_1", newcontent, TextField.TYPE_STORED));
+      newdoc.add(newTextField(rnd, "FIELD_1", newcontent, Field.Store.YES));
       writer.addDocument(newdoc);
     }
     // add a doc with high tf in field different_field
@@ -248,7 +248,7 @@ public class TestHighFreqTerms extends L
     for (int i = 0; i < targetTF; i++) {
       content += "TF150 ";
     }
-    doc.add(newField(rnd, "different_field", content, TextField.TYPE_STORED));
+    doc.add(newTextField(rnd, "different_field", content, Field.Store.YES));
     writer.addDocument(doc);
     writer.close();
     

Modified: lucene/dev/branches/branch_4x/lucene/queries/src/test/org/apache/lucene/queries/BooleanFilterTest.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/branch_4x/lucene/queries/src/test/org/apache/lucene/queries/BooleanFilterTest.java?rev=1348639&r1=1348638&r2=1348639&view=diff
==============================================================================
--- lucene/dev/branches/branch_4x/lucene/queries/src/test/org/apache/lucene/queries/BooleanFilterTest.java (original)
+++ lucene/dev/branches/branch_4x/lucene/queries/src/test/org/apache/lucene/queries/BooleanFilterTest.java Sun Jun 10 18:27:08 2012
@@ -20,7 +20,7 @@ package org.apache.lucene.queries;
 import org.apache.lucene.analysis.MockAnalyzer;
 import org.apache.lucene.analysis.MockTokenizer;
 import org.apache.lucene.document.Document;
-import org.apache.lucene.document.TextField;
+import org.apache.lucene.document.Field;
 import org.apache.lucene.index.AtomicReader;
 import org.apache.lucene.index.AtomicReaderContext;
 import org.apache.lucene.index.RandomIndexWriter;
@@ -69,10 +69,10 @@ public class BooleanFilterTest extends L
 
   private void addDoc(RandomIndexWriter writer, String accessRights, String price, String date, String inStock) throws IOException {
     Document doc = new Document();
-    doc.add(newField("accessRights", accessRights, TextField.TYPE_STORED));
-    doc.add(newField("price", price, TextField.TYPE_STORED));
-    doc.add(newField("date", date, TextField.TYPE_STORED));
-    doc.add(newField("inStock", inStock, TextField.TYPE_STORED));
+    doc.add(newTextField("accessRights", accessRights, Field.Store.YES));
+    doc.add(newTextField("price", price, Field.Store.YES));
+    doc.add(newTextField("date", date, Field.Store.YES));
+    doc.add(newTextField("inStock", inStock, Field.Store.YES));
     writer.addDocument(doc);
   }
 

Modified: lucene/dev/branches/branch_4x/lucene/queries/src/test/org/apache/lucene/queries/ChainedFilterTest.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/branch_4x/lucene/queries/src/test/org/apache/lucene/queries/ChainedFilterTest.java?rev=1348639&r1=1348638&r2=1348639&view=diff
==============================================================================
--- lucene/dev/branches/branch_4x/lucene/queries/src/test/org/apache/lucene/queries/ChainedFilterTest.java (original)
+++ lucene/dev/branches/branch_4x/lucene/queries/src/test/org/apache/lucene/queries/ChainedFilterTest.java Sun Jun 10 18:27:08 2012
@@ -21,7 +21,7 @@ import java.util.Calendar;
 import java.util.GregorianCalendar;
 
 import org.apache.lucene.document.Document;
-import org.apache.lucene.document.StringField;
+import org.apache.lucene.document.Field;
 import org.apache.lucene.index.IndexReader;
 import org.apache.lucene.index.RandomIndexWriter;
 import org.apache.lucene.index.Term;
@@ -62,9 +62,9 @@ public class ChainedFilterTest extends L
 
     for (int i = 0; i < MAX; i++) {
       Document doc = new Document();
-      doc.add(newField("key", "" + (i + 1), StringField.TYPE_STORED));
-      doc.add(newField("owner", (i < MAX / 2) ? "bob" : "sue", StringField.TYPE_STORED));
-      doc.add(newField("date", cal.getTime().toString(), StringField.TYPE_STORED));
+      doc.add(newStringField("key", "" + (i + 1), Field.Store.YES));
+      doc.add(newStringField("owner", (i < MAX / 2) ? "bob" : "sue", Field.Store.YES));
+      doc.add(newStringField("date", cal.getTime().toString(), Field.Store.YES));
       writer.addDocument(doc);
 
       cal.add(Calendar.DATE, 1);

Modified: lucene/dev/branches/branch_4x/lucene/queries/src/test/org/apache/lucene/queries/TermsFilterTest.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/branch_4x/lucene/queries/src/test/org/apache/lucene/queries/TermsFilterTest.java?rev=1348639&r1=1348638&r2=1348639&view=diff
==============================================================================
--- lucene/dev/branches/branch_4x/lucene/queries/src/test/org/apache/lucene/queries/TermsFilterTest.java (original)
+++ lucene/dev/branches/branch_4x/lucene/queries/src/test/org/apache/lucene/queries/TermsFilterTest.java Sun Jun 10 18:27:08 2012
@@ -20,7 +20,7 @@ package org.apache.lucene.queries;
 import java.util.HashSet;
 
 import org.apache.lucene.document.Document;
-import org.apache.lucene.document.StringField;
+import org.apache.lucene.document.Field;
 import org.apache.lucene.index.AtomicReaderContext;
 import org.apache.lucene.index.IndexReader;
 import org.apache.lucene.index.MultiReader;
@@ -58,7 +58,7 @@ public class TermsFilterTest extends Luc
     for (int i = 0; i < 100; i++) {
       Document doc = new Document();
       int term = i * 10; //terms are units of 10;
-      doc.add(newField(fieldName, "" + term, StringField.TYPE_STORED));
+      doc.add(newStringField(fieldName, "" + term, Field.Store.YES));
       w.addDocument(doc);
     }
     IndexReader reader = new SlowCompositeReaderWrapper(w.getReader());
@@ -92,7 +92,7 @@ public class TermsFilterTest extends Luc
     Directory rd1 = newDirectory();
     RandomIndexWriter w1 = new RandomIndexWriter(random(), rd1);
     Document doc = new Document();
-    doc.add(newField(fieldName, "content1", StringField.TYPE_STORED));
+    doc.add(newStringField(fieldName, "content1", Field.Store.YES));
     w1.addDocument(doc);
     IndexReader reader1 = w1.getReader();
     w1.close();
@@ -101,7 +101,7 @@ public class TermsFilterTest extends Luc
     Directory rd2 = newDirectory();
     RandomIndexWriter w2 = new RandomIndexWriter(random(), rd2);
     doc = new Document();
-    doc.add(newField(fieldName, "content2", StringField.TYPE_STORED));
+    doc.add(newStringField(fieldName, "content2", Field.Store.YES));
     w2.addDocument(doc);
     IndexReader reader2 = w2.getReader();
     w2.close();

Modified: lucene/dev/branches/branch_4x/lucene/queries/src/test/org/apache/lucene/queries/function/FunctionTestSetup.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/branch_4x/lucene/queries/src/test/org/apache/lucene/queries/function/FunctionTestSetup.java?rev=1348639&r1=1348638&r2=1348639&view=diff
==============================================================================
--- lucene/dev/branches/branch_4x/lucene/queries/src/test/org/apache/lucene/queries/function/FunctionTestSetup.java (original)
+++ lucene/dev/branches/branch_4x/lucene/queries/src/test/org/apache/lucene/queries/function/FunctionTestSetup.java Sun Jun 10 18:27:08 2012
@@ -135,7 +135,7 @@ public abstract class FunctionTestSetup 
     f = newField(ID_FIELD, id2String(scoreAndID), customType); // for debug purposes
     d.add(f);
 
-    FieldType customType2 = new FieldType(TextField.TYPE_UNSTORED);
+    FieldType customType2 = new FieldType(TextField.TYPE_NOT_STORED);
     customType2.setOmitNorms(true);
     f = newField(TEXT_FIELD, "text of doc" + scoreAndID + textLine(i), customType2); // for regular search
     d.add(f);

Modified: lucene/dev/branches/branch_4x/lucene/queries/src/test/org/apache/lucene/queries/function/TestBoostedQuery.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/branch_4x/lucene/queries/src/test/org/apache/lucene/queries/function/TestBoostedQuery.java?rev=1348639&r1=1348638&r2=1348639&view=diff
==============================================================================
--- lucene/dev/branches/branch_4x/lucene/queries/src/test/org/apache/lucene/queries/function/TestBoostedQuery.java (original)
+++ lucene/dev/branches/branch_4x/lucene/queries/src/test/org/apache/lucene/queries/function/TestBoostedQuery.java Sun Jun 10 18:27:08 2012
@@ -1,6 +1,5 @@
 package org.apache.lucene.queries.function;
 
-import java.io.IOException;
 
 import org.apache.lucene.analysis.MockAnalyzer;
 import org.apache.lucene.document.Document;
@@ -56,7 +55,7 @@ public class TestBoostedQuery extends Lu
     iwConfig.setMergePolicy(newLogMergePolicy());
     RandomIndexWriter iw = new RandomIndexWriter(random(), dir, iwConfig);
     Document document = new Document();
-    Field idField = new StringField("id", "");
+    Field idField = new StringField("id", "", Field.Store.NO);
     document.add(idField);
     iw.addDocument(document);
     ir = iw.getReader();

Modified: lucene/dev/branches/branch_4x/lucene/queries/src/test/org/apache/lucene/queries/function/TestValueSources.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/branch_4x/lucene/queries/src/test/org/apache/lucene/queries/function/TestValueSources.java?rev=1348639&r1=1348638&r2=1348639&view=diff
==============================================================================
--- lucene/dev/branches/branch_4x/lucene/queries/src/test/org/apache/lucene/queries/function/TestValueSources.java (original)
+++ lucene/dev/branches/branch_4x/lucene/queries/src/test/org/apache/lucene/queries/function/TestValueSources.java Sun Jun 10 18:27:08 2012
@@ -98,23 +98,23 @@ public class TestValueSources extends Lu
     iwConfig.setMergePolicy(newLogMergePolicy());
     RandomIndexWriter iw = new RandomIndexWriter(random(), dir, iwConfig);
     Document document = new Document();
-    Field idField = new StringField("id", "");
+    Field idField = new StringField("id", "", Field.Store.NO);
     document.add(idField);
-    Field byteField = new StringField("byte", "");
+    Field byteField = new StringField("byte", "", Field.Store.NO);
     document.add(byteField);
-    Field doubleField = new StringField("double", "");
+    Field doubleField = new StringField("double", "", Field.Store.NO);
     document.add(doubleField);
-    Field floatField = new StringField("float", "");
+    Field floatField = new StringField("float", "", Field.Store.NO);
     document.add(floatField);
-    Field intField = new StringField("int", "");
+    Field intField = new StringField("int", "", Field.Store.NO);
     document.add(intField);
-    Field longField = new StringField("long", "");
+    Field longField = new StringField("long", "", Field.Store.NO);
     document.add(longField);
-    Field shortField = new StringField("short", "");
+    Field shortField = new StringField("short", "", Field.Store.NO);
     document.add(shortField);
-    Field stringField = new StringField("string", "");
+    Field stringField = new StringField("string", "", Field.Store.NO);
     document.add(stringField);
-    Field textField = new TextField("text", "");
+    Field textField = new TextField("text", "", Field.Store.NO);
     document.add(textField);
     
     for (String [] doc : documents) {

Modified: lucene/dev/branches/branch_4x/lucene/queries/src/test/org/apache/lucene/queries/mlt/TestMoreLikeThis.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/branch_4x/lucene/queries/src/test/org/apache/lucene/queries/mlt/TestMoreLikeThis.java?rev=1348639&r1=1348638&r2=1348639&view=diff
==============================================================================
--- lucene/dev/branches/branch_4x/lucene/queries/src/test/org/apache/lucene/queries/mlt/TestMoreLikeThis.java (original)
+++ lucene/dev/branches/branch_4x/lucene/queries/src/test/org/apache/lucene/queries/mlt/TestMoreLikeThis.java Sun Jun 10 18:27:08 2012
@@ -26,7 +26,7 @@ import java.util.Map;
 import org.apache.lucene.analysis.MockAnalyzer;
 import org.apache.lucene.analysis.MockTokenizer;
 import org.apache.lucene.document.Document;
-import org.apache.lucene.document.TextField;
+import org.apache.lucene.document.Field;
 import org.apache.lucene.index.IndexReader;
 import org.apache.lucene.index.RandomIndexWriter;
 import org.apache.lucene.search.BooleanClause;
@@ -65,7 +65,7 @@ public class TestMoreLikeThis extends Lu
   
   private void addDoc(RandomIndexWriter writer, String text) throws IOException {
     Document doc = new Document();
-    doc.add(newField("text", text, TextField.TYPE_STORED));
+    doc.add(newTextField("text", text, Field.Store.YES));
     writer.addDocument(doc);
   }
   

Modified: lucene/dev/branches/branch_4x/lucene/queryparser/src/test/org/apache/lucene/queryparser/classic/TestMultiFieldQueryParser.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/branch_4x/lucene/queryparser/src/test/org/apache/lucene/queryparser/classic/TestMultiFieldQueryParser.java?rev=1348639&r1=1348638&r2=1348639&view=diff
==============================================================================
--- lucene/dev/branches/branch_4x/lucene/queryparser/src/test/org/apache/lucene/queryparser/classic/TestMultiFieldQueryParser.java (original)
+++ lucene/dev/branches/branch_4x/lucene/queryparser/src/test/org/apache/lucene/queryparser/classic/TestMultiFieldQueryParser.java Sun Jun 10 18:27:08 2012
@@ -23,7 +23,7 @@ import java.util.Map;
 
 import org.apache.lucene.analysis.*;
 import org.apache.lucene.document.Document;
-import org.apache.lucene.document.TextField;
+import org.apache.lucene.document.Field;
 import org.apache.lucene.index.DirectoryReader;
 import org.apache.lucene.index.IndexReader;
 import org.apache.lucene.index.IndexWriter;
@@ -283,7 +283,7 @@ public class TestMultiFieldQueryParser e
     Directory ramDir = newDirectory();
     IndexWriter iw =  new IndexWriter(ramDir, newIndexWriterConfig(TEST_VERSION_CURRENT, analyzer));
     Document doc = new Document();
-    doc.add(newField("body", "blah the footest blah", TextField.TYPE_UNSTORED));
+    doc.add(newTextField("body", "blah the footest blah", Field.Store.NO));
     iw.addDocument(doc);
     iw.close();
     

Modified: lucene/dev/branches/branch_4x/lucene/queryparser/src/test/org/apache/lucene/queryparser/complexPhrase/TestComplexPhraseQuery.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/branch_4x/lucene/queryparser/src/test/org/apache/lucene/queryparser/complexPhrase/TestComplexPhraseQuery.java?rev=1348639&r1=1348638&r2=1348639&view=diff
==============================================================================
--- lucene/dev/branches/branch_4x/lucene/queryparser/src/test/org/apache/lucene/queryparser/complexPhrase/TestComplexPhraseQuery.java (original)
+++ lucene/dev/branches/branch_4x/lucene/queryparser/src/test/org/apache/lucene/queryparser/complexPhrase/TestComplexPhraseQuery.java Sun Jun 10 18:27:08 2012
@@ -22,7 +22,7 @@ import java.util.HashSet;
 import org.apache.lucene.analysis.Analyzer;
 import org.apache.lucene.analysis.MockAnalyzer;
 import org.apache.lucene.document.Document;
-import org.apache.lucene.document.TextField;
+import org.apache.lucene.document.Field;
 import org.apache.lucene.index.DirectoryReader;
 import org.apache.lucene.index.IndexReader;
 import org.apache.lucene.index.IndexWriter;
@@ -120,8 +120,8 @@ public class TestComplexPhraseQuery exte
     IndexWriter w = new IndexWriter(rd, newIndexWriterConfig(TEST_VERSION_CURRENT, analyzer));
     for (int i = 0; i < docsContent.length; i++) {
       Document doc = new Document();
-      doc.add(newField("name", docsContent[i].name, TextField.TYPE_STORED));
-      doc.add(newField("id", docsContent[i].id, TextField.TYPE_STORED));
+      doc.add(newTextField("name", docsContent[i].name, Field.Store.YES));
+      doc.add(newTextField("id", docsContent[i].id, Field.Store.YES));
       w.addDocument(doc);
     }
     w.close();

Modified: lucene/dev/branches/branch_4x/lucene/queryparser/src/test/org/apache/lucene/queryparser/flexible/standard/TestMultiFieldQPHelper.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/branch_4x/lucene/queryparser/src/test/org/apache/lucene/queryparser/flexible/standard/TestMultiFieldQPHelper.java?rev=1348639&r1=1348638&r2=1348639&view=diff
==============================================================================
--- lucene/dev/branches/branch_4x/lucene/queryparser/src/test/org/apache/lucene/queryparser/flexible/standard/TestMultiFieldQPHelper.java (original)
+++ lucene/dev/branches/branch_4x/lucene/queryparser/src/test/org/apache/lucene/queryparser/flexible/standard/TestMultiFieldQPHelper.java Sun Jun 10 18:27:08 2012
@@ -17,15 +17,13 @@ package org.apache.lucene.queryparser.fl
  * limitations under the License.
  */
 
-import java.io.IOException;
 import java.io.Reader;
-import java.io.StringReader;
 import java.util.HashMap;
 import java.util.Map;
 
 import org.apache.lucene.analysis.*;
 import org.apache.lucene.document.Document;
-import org.apache.lucene.document.TextField;
+import org.apache.lucene.document.Field;
 import org.apache.lucene.index.DirectoryReader;
 import org.apache.lucene.index.IndexReader;
 import org.apache.lucene.index.IndexWriter;
@@ -322,7 +320,7 @@ public class TestMultiFieldQPHelper exte
     Directory ramDir = newDirectory();
     IndexWriter iw = new IndexWriter(ramDir, newIndexWriterConfig(TEST_VERSION_CURRENT, analyzer));
     Document doc = new Document();
-    doc.add(newField("body", "blah the footest blah", TextField.TYPE_UNSTORED));
+    doc.add(newTextField("body", "blah the footest blah", Field.Store.NO));
     iw.addDocument(doc);
     iw.close();
 

Modified: lucene/dev/branches/branch_4x/lucene/queryparser/src/test/org/apache/lucene/queryparser/flexible/standard/TestNumericQueryParser.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/branch_4x/lucene/queryparser/src/test/org/apache/lucene/queryparser/flexible/standard/TestNumericQueryParser.java?rev=1348639&r1=1348638&r2=1348639&view=diff
==============================================================================
--- lucene/dev/branches/branch_4x/lucene/queryparser/src/test/org/apache/lucene/queryparser/flexible/standard/TestNumericQueryParser.java (original)
+++ lucene/dev/branches/branch_4x/lucene/queryparser/src/test/org/apache/lucene/queryparser/flexible/standard/TestNumericQueryParser.java Sun Jun 10 18:27:08 2012
@@ -199,7 +199,7 @@ public class TestNumericQueryParser exte
       numericConfigMap.put(type.name(), new NumericConfig(PRECISION_STEP,
           NUMBER_FORMAT, type));
 
-      FieldType ft = new FieldType(IntField.TYPE);
+      FieldType ft = new FieldType(IntField.TYPE_NOT_STORED);
       ft.setNumericType(type);
       ft.setStored(true);
       ft.setNumericPrecisionStep(PRECISION_STEP);
@@ -229,7 +229,7 @@ public class TestNumericQueryParser exte
     
     numericConfigMap.put(DATE_FIELD_NAME, new NumericConfig(PRECISION_STEP,
         DATE_FORMAT, NumericType.LONG));
-    FieldType ft = new FieldType(LongField.TYPE);
+    FieldType ft = new FieldType(LongField.TYPE_NOT_STORED);
     ft.setStored(true);
     ft.setNumericPrecisionStep(PRECISION_STEP);
     LongField dateField = new LongField(DATE_FIELD_NAME, 0l, ft);

Modified: lucene/dev/branches/branch_4x/lucene/queryparser/src/test/org/apache/lucene/queryparser/flexible/standard/TestQPHelper.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/branch_4x/lucene/queryparser/src/test/org/apache/lucene/queryparser/flexible/standard/TestQPHelper.java?rev=1348639&r1=1348638&r2=1348639&view=diff
==============================================================================
--- lucene/dev/branches/branch_4x/lucene/queryparser/src/test/org/apache/lucene/queryparser/flexible/standard/TestQPHelper.java (original)
+++ lucene/dev/branches/branch_4x/lucene/queryparser/src/test/org/apache/lucene/queryparser/flexible/standard/TestQPHelper.java Sun Jun 10 18:27:08 2012
@@ -19,7 +19,6 @@ package org.apache.lucene.queryparser.fl
 
 import java.io.IOException;
 import java.io.Reader;
-import java.io.StringReader;
 import java.text.DateFormat;
 import java.util.Calendar;
 import java.util.Date;
@@ -35,7 +34,7 @@ import org.apache.lucene.analysis.tokena
 import org.apache.lucene.analysis.tokenattributes.PositionIncrementAttribute;
 import org.apache.lucene.document.DateTools;
 import org.apache.lucene.document.Document;
-import org.apache.lucene.document.TextField;
+import org.apache.lucene.document.Field;
 import org.apache.lucene.index.DirectoryReader;
 import org.apache.lucene.index.IndexReader;
 import org.apache.lucene.index.IndexWriter;
@@ -1289,7 +1288,7 @@ public class TestQPHelper extends Lucene
     Directory dir = newDirectory();
     IndexWriter w = new IndexWriter(dir, newIndexWriterConfig(TEST_VERSION_CURRENT, new CannedAnalyzer()));
     Document doc = new Document();
-    doc.add(newField("field", "", TextField.TYPE_UNSTORED));
+    doc.add(newTextField("field", "", Field.Store.NO));
     w.addDocument(doc);
     IndexReader r = DirectoryReader.open(w, true);
     IndexSearcher s = newSearcher(r);

Modified: lucene/dev/branches/branch_4x/lucene/queryparser/src/test/org/apache/lucene/queryparser/surround/query/SingleFieldTestDb.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/branch_4x/lucene/queryparser/src/test/org/apache/lucene/queryparser/surround/query/SingleFieldTestDb.java?rev=1348639&r1=1348638&r2=1348639&view=diff
==============================================================================
--- lucene/dev/branches/branch_4x/lucene/queryparser/src/test/org/apache/lucene/queryparser/surround/query/SingleFieldTestDb.java (original)
+++ lucene/dev/branches/branch_4x/lucene/queryparser/src/test/org/apache/lucene/queryparser/surround/query/SingleFieldTestDb.java Sun Jun 10 18:27:08 2012
@@ -19,6 +19,7 @@ package org.apache.lucene.queryparser.su
 
 import java.util.Random;
 
+import org.apache.lucene.document.Field;
 import org.apache.lucene.store.Directory;
 import org.apache.lucene.store.MockDirectoryWrapper;
 import org.apache.lucene.store.RAMDirectory;
@@ -44,7 +45,7 @@ public class SingleFieldTestDb {
           new MockAnalyzer(random)));
       for (int j = 0; j < docs.length; j++) {
         Document d = new Document();
-        d.add(new TextField(fieldName, docs[j]));
+        d.add(new TextField(fieldName, docs[j], Field.Store.NO));
         writer.addDocument(d);
       }
       writer.close();

Modified: lucene/dev/branches/branch_4x/lucene/queryparser/src/test/org/apache/lucene/queryparser/util/QueryParserTestBase.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/branch_4x/lucene/queryparser/src/test/org/apache/lucene/queryparser/util/QueryParserTestBase.java?rev=1348639&r1=1348638&r2=1348639&view=diff
==============================================================================
--- lucene/dev/branches/branch_4x/lucene/queryparser/src/test/org/apache/lucene/queryparser/util/QueryParserTestBase.java (original)
+++ lucene/dev/branches/branch_4x/lucene/queryparser/src/test/org/apache/lucene/queryparser/util/QueryParserTestBase.java Sun Jun 10 18:27:08 2012
@@ -31,7 +31,7 @@ import org.apache.lucene.analysis.tokena
 import org.apache.lucene.analysis.tokenattributes.PositionIncrementAttribute;
 import org.apache.lucene.document.DateTools;
 import org.apache.lucene.document.Document;
-import org.apache.lucene.document.TextField;
+import org.apache.lucene.document.Field;
 import org.apache.lucene.index.DirectoryReader;
 import org.apache.lucene.index.IndexReader;
 import org.apache.lucene.index.IndexWriter;
@@ -1111,7 +1111,7 @@ public abstract class QueryParserTestBas
     Analyzer a = new MockAnalyzer(random(), MockTokenizer.SIMPLE, true, MockTokenFilter.ENGLISH_STOPSET, true);
     IndexWriter w = new IndexWriter(dir, newIndexWriterConfig( TEST_VERSION_CURRENT, a));
     Document doc = new Document();
-    doc.add(newField("f", "the wizard of ozzy", TextField.TYPE_UNSTORED));
+    doc.add(newTextField("f", "the wizard of ozzy", Field.Store.NO));
     w.addDocument(doc);
     IndexReader r = DirectoryReader.open(w, true);
     w.close();

Modified: lucene/dev/branches/branch_4x/lucene/queryparser/src/test/org/apache/lucene/queryparser/xml/TestParser.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/branch_4x/lucene/queryparser/src/test/org/apache/lucene/queryparser/xml/TestParser.java?rev=1348639&r1=1348638&r2=1348639&view=diff
==============================================================================
--- lucene/dev/branches/branch_4x/lucene/queryparser/src/test/org/apache/lucene/queryparser/xml/TestParser.java (original)
+++ lucene/dev/branches/branch_4x/lucene/queryparser/src/test/org/apache/lucene/queryparser/xml/TestParser.java Sun Jun 10 18:27:08 2012
@@ -22,8 +22,8 @@ import org.apache.lucene.analysis.MockAn
 import org.apache.lucene.analysis.MockTokenFilter;
 import org.apache.lucene.analysis.MockTokenizer;
 import org.apache.lucene.document.Document;
+import org.apache.lucene.document.Field;
 import org.apache.lucene.document.IntField;
-import org.apache.lucene.document.TextField;
 import org.apache.lucene.index.AtomicReaderContext;
 import org.apache.lucene.index.DirectoryReader;
 import org.apache.lucene.index.IndexReader;
@@ -69,9 +69,9 @@ public class TestParser extends LuceneTe
       String date = line.substring(0, endOfDate).trim();
       String content = line.substring(endOfDate).trim();
       Document doc = new Document();
-      doc.add(newField("date", date, TextField.TYPE_STORED));
-      doc.add(newField("contents", content, TextField.TYPE_STORED));
-      doc.add(new IntField("date2", Integer.valueOf(date)));
+      doc.add(newTextField("date", date, Field.Store.YES));
+      doc.add(newTextField("contents", content, Field.Store.YES));
+      doc.add(new IntField("date2", Integer.valueOf(date), Field.Store.NO));
       writer.addDocument(doc);
       line = d.readLine();
     }

Modified: lucene/dev/branches/branch_4x/lucene/queryparser/src/test/org/apache/lucene/queryparser/xml/TestQueryTemplateManager.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/branch_4x/lucene/queryparser/src/test/org/apache/lucene/queryparser/xml/TestQueryTemplateManager.java?rev=1348639&r1=1348638&r2=1348639&view=diff
==============================================================================
--- lucene/dev/branches/branch_4x/lucene/queryparser/src/test/org/apache/lucene/queryparser/xml/TestQueryTemplateManager.java (original)
+++ lucene/dev/branches/branch_4x/lucene/queryparser/src/test/org/apache/lucene/queryparser/xml/TestQueryTemplateManager.java Sun Jun 10 18:27:08 2012
@@ -19,7 +19,7 @@ package org.apache.lucene.queryparser.xm
 
 import org.apache.lucene.analysis.Analyzer;
 import org.apache.lucene.analysis.MockAnalyzer;
-import org.apache.lucene.document.TextField;
+import org.apache.lucene.document.Field;
 import org.apache.lucene.index.DirectoryReader;
 import org.apache.lucene.index.IndexReader;
 import org.apache.lucene.index.IndexWriter;
@@ -129,7 +129,7 @@ public class TestQueryTemplateManager ex
       String name = st.nextToken().trim();
       if (st.hasMoreTokens()) {
         String value = st.nextToken().trim();
-        result.add(newField(name, value, TextField.TYPE_STORED));
+        result.add(newTextField(name, value, Field.Store.YES));
       }
     }
     return result;

Modified: lucene/dev/branches/branch_4x/lucene/sandbox/src/test/org/apache/lucene/sandbox/queries/DuplicateFilterTest.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/branch_4x/lucene/sandbox/src/test/org/apache/lucene/sandbox/queries/DuplicateFilterTest.java?rev=1348639&r1=1348638&r2=1348639&view=diff
==============================================================================
--- lucene/dev/branches/branch_4x/lucene/sandbox/src/test/org/apache/lucene/sandbox/queries/DuplicateFilterTest.java (original)
+++ lucene/dev/branches/branch_4x/lucene/sandbox/src/test/org/apache/lucene/sandbox/queries/DuplicateFilterTest.java Sun Jun 10 18:27:08 2012
@@ -22,8 +22,7 @@ import java.util.HashSet;
 
 import org.apache.lucene.analysis.MockAnalyzer;
 import org.apache.lucene.document.Document;
-import org.apache.lucene.document.StringField;
-import org.apache.lucene.document.TextField;
+import org.apache.lucene.document.Field;
 import org.apache.lucene.index.*;
 import org.apache.lucene.search.DocIdSetIterator;
 import org.apache.lucene.search.IndexSearcher;
@@ -76,9 +75,9 @@ public class DuplicateFilterTest extends
 
   private void addDoc(RandomIndexWriter writer, String url, String text, String date) throws IOException {
     Document doc = new Document();
-    doc.add(newField(KEY_FIELD, url, StringField.TYPE_STORED));
-    doc.add(newField("text", text, TextField.TYPE_STORED));
-    doc.add(newField("date", date, TextField.TYPE_STORED));
+    doc.add(newStringField(KEY_FIELD, url, Field.Store.YES));
+    doc.add(newTextField("text", text, Field.Store.YES));
+    doc.add(newTextField("date", date, Field.Store.YES));
     writer.addDocument(doc);
   }
 

Modified: lucene/dev/branches/branch_4x/lucene/sandbox/src/test/org/apache/lucene/sandbox/queries/FuzzyLikeThisQueryTest.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/branch_4x/lucene/sandbox/src/test/org/apache/lucene/sandbox/queries/FuzzyLikeThisQueryTest.java?rev=1348639&r1=1348638&r2=1348639&view=diff
==============================================================================
--- lucene/dev/branches/branch_4x/lucene/sandbox/src/test/org/apache/lucene/sandbox/queries/FuzzyLikeThisQueryTest.java (original)
+++ lucene/dev/branches/branch_4x/lucene/sandbox/src/test/org/apache/lucene/sandbox/queries/FuzzyLikeThisQueryTest.java Sun Jun 10 18:27:08 2012
@@ -20,7 +20,7 @@ package org.apache.lucene.sandbox.querie
 import org.apache.lucene.analysis.Analyzer;
 import org.apache.lucene.analysis.MockAnalyzer;
 import org.apache.lucene.document.Document;
-import org.apache.lucene.document.TextField;
+import org.apache.lucene.document.Field;
 import org.apache.lucene.index.IndexReader;
 import org.apache.lucene.index.RandomIndexWriter;
 import org.apache.lucene.index.Term;
@@ -69,8 +69,8 @@ public class FuzzyLikeThisQueryTest exte
 
   private void addDoc(RandomIndexWriter writer, String name, String id) throws IOException {
     Document doc = new Document();
-    doc.add(newField("name", name, TextField.TYPE_STORED));
-    doc.add(newField("id", id, TextField.TYPE_STORED));
+    doc.add(newTextField("name", name, Field.Store.YES));
+    doc.add(newTextField("id", id, Field.Store.YES));
     writer.addDocument(doc);
   }
 

Modified: lucene/dev/branches/branch_4x/lucene/sandbox/src/test/org/apache/lucene/sandbox/queries/TestSlowCollationMethods.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/branch_4x/lucene/sandbox/src/test/org/apache/lucene/sandbox/queries/TestSlowCollationMethods.java?rev=1348639&r1=1348638&r2=1348639&view=diff
==============================================================================
--- lucene/dev/branches/branch_4x/lucene/sandbox/src/test/org/apache/lucene/sandbox/queries/TestSlowCollationMethods.java (original)
+++ lucene/dev/branches/branch_4x/lucene/sandbox/src/test/org/apache/lucene/sandbox/queries/TestSlowCollationMethods.java Sun Jun 10 18:27:08 2012
@@ -6,7 +6,6 @@ import java.util.Locale;
 
 import org.apache.lucene.document.Document;
 import org.apache.lucene.document.Field;
-import org.apache.lucene.document.StringField;
 import org.apache.lucene.index.IndexReader;
 import org.apache.lucene.index.RandomIndexWriter;
 import org.apache.lucene.search.*;
@@ -58,7 +57,7 @@ public class TestSlowCollationMethods ex
     for (int i = 0; i < numDocs; i++) {
       Document doc = new Document();
       String value = _TestUtil.randomUnicodeString(random());
-      Field field = newField("field", value, StringField.TYPE_STORED);
+      Field field = newStringField("field", value, Field.Store.YES);
       doc.add(field);
       iw.addDocument(doc);
     }

Modified: lucene/dev/branches/branch_4x/lucene/sandbox/src/test/org/apache/lucene/sandbox/queries/TestSlowFuzzyQuery.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/branch_4x/lucene/sandbox/src/test/org/apache/lucene/sandbox/queries/TestSlowFuzzyQuery.java?rev=1348639&r1=1348638&r2=1348639&view=diff
==============================================================================
--- lucene/dev/branches/branch_4x/lucene/sandbox/src/test/org/apache/lucene/sandbox/queries/TestSlowFuzzyQuery.java (original)
+++ lucene/dev/branches/branch_4x/lucene/sandbox/src/test/org/apache/lucene/sandbox/queries/TestSlowFuzzyQuery.java Sun Jun 10 18:27:08 2012
@@ -23,7 +23,7 @@ import java.io.IOException;
 
 import org.apache.lucene.analysis.MockAnalyzer;
 import org.apache.lucene.document.Document;
-import org.apache.lucene.document.TextField;
+import org.apache.lucene.document.Field;
 import org.apache.lucene.index.IndexReader;
 import org.apache.lucene.index.MultiReader;
 import org.apache.lucene.index.RandomIndexWriter;
@@ -462,7 +462,7 @@ public class TestSlowFuzzyQuery extends 
 
   private void addDoc(String text, RandomIndexWriter writer) throws IOException {
     Document doc = new Document();
-    doc.add(newField("field", text, TextField.TYPE_STORED));
+    doc.add(newTextField("field", text, Field.Store.YES));
     writer.addDocument(doc);
   }
 }

Modified: lucene/dev/branches/branch_4x/lucene/sandbox/src/test/org/apache/lucene/sandbox/queries/TestSlowFuzzyQuery2.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/branch_4x/lucene/sandbox/src/test/org/apache/lucene/sandbox/queries/TestSlowFuzzyQuery2.java?rev=1348639&r1=1348638&r2=1348639&view=diff
==============================================================================
--- lucene/dev/branches/branch_4x/lucene/sandbox/src/test/org/apache/lucene/sandbox/queries/TestSlowFuzzyQuery2.java (original)
+++ lucene/dev/branches/branch_4x/lucene/sandbox/src/test/org/apache/lucene/sandbox/queries/TestSlowFuzzyQuery2.java Sun Jun 10 18:27:08 2012
@@ -25,7 +25,6 @@ import org.apache.lucene.analysis.MockAn
 import org.apache.lucene.analysis.MockTokenizer;
 import org.apache.lucene.document.Document;
 import org.apache.lucene.document.Field;
-import org.apache.lucene.document.TextField;
 import org.apache.lucene.index.IndexReader;
 import org.apache.lucene.index.RandomIndexWriter;
 import org.apache.lucene.index.Term;
@@ -93,7 +92,7 @@ public class TestSlowFuzzyQuery2 extends
     RandomIndexWriter writer = new RandomIndexWriter(random(), dir, newIndexWriterConfig(TEST_VERSION_CURRENT, new MockAnalyzer(random(), MockTokenizer.KEYWORD, false)).setMergePolicy(newLogMergePolicy()));
 
     Document doc = new Document();
-    Field field = newField("field", "", TextField.TYPE_UNSTORED);
+    Field field = newTextField("field", "", Field.Store.NO);
     doc.add(field);
     
     for (int i = 0; i < terms; i++) {

Modified: lucene/dev/branches/branch_4x/lucene/sandbox/src/test/org/apache/lucene/sandbox/queries/regex/TestRegexQuery.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/branch_4x/lucene/sandbox/src/test/org/apache/lucene/sandbox/queries/regex/TestRegexQuery.java?rev=1348639&r1=1348638&r2=1348639&view=diff
==============================================================================
--- lucene/dev/branches/branch_4x/lucene/sandbox/src/test/org/apache/lucene/sandbox/queries/regex/TestRegexQuery.java (original)
+++ lucene/dev/branches/branch_4x/lucene/sandbox/src/test/org/apache/lucene/sandbox/queries/regex/TestRegexQuery.java Sun Jun 10 18:27:08 2012
@@ -17,6 +17,7 @@ package org.apache.lucene.sandbox.querie
  * limitations under the License.
  */
 
+import org.apache.lucene.document.Field;
 import org.apache.lucene.search.spans.SpanMultiTermQueryWrapper;
 import org.apache.lucene.store.Directory;
 import org.apache.lucene.index.IndexReader;
@@ -25,7 +26,6 @@ import org.apache.lucene.index.RandomInd
 import org.apache.lucene.index.Term;
 import org.apache.lucene.index.Terms;
 import org.apache.lucene.document.Document;
-import org.apache.lucene.document.TextField;
 import org.apache.lucene.search.IndexSearcher;
 import org.apache.lucene.index.TermsEnum;
 
@@ -47,7 +47,7 @@ public class TestRegexQuery extends Luce
     directory = newDirectory();
     RandomIndexWriter writer = new RandomIndexWriter(random(), directory);
     Document doc = new Document();
-    doc.add(newField(FN, "the quick brown fox jumps over the lazy dog", TextField.TYPE_UNSTORED));
+    doc.add(newTextField(FN, "the quick brown fox jumps over the lazy dog", Field.Store.NO));
     writer.addDocument(doc);
     reader = writer.getReader();
     writer.close();

Modified: lucene/dev/branches/branch_4x/lucene/sandbox/src/test/org/apache/lucene/sandbox/queries/regex/TestSpanRegexQuery.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/branch_4x/lucene/sandbox/src/test/org/apache/lucene/sandbox/queries/regex/TestSpanRegexQuery.java?rev=1348639&r1=1348638&r2=1348639&view=diff
==============================================================================
--- lucene/dev/branches/branch_4x/lucene/sandbox/src/test/org/apache/lucene/sandbox/queries/regex/TestSpanRegexQuery.java (original)
+++ lucene/dev/branches/branch_4x/lucene/sandbox/src/test/org/apache/lucene/sandbox/queries/regex/TestSpanRegexQuery.java Sun Jun 10 18:27:08 2012
@@ -17,24 +17,19 @@ package org.apache.lucene.sandbox.querie
  * limitations under the License.
  */
 
-import java.io.IOException;
 
 import org.apache.lucene.analysis.MockAnalyzer;
 import org.apache.lucene.document.Document;
-import org.apache.lucene.document.FieldType;
-import org.apache.lucene.document.TextField;
-import org.apache.lucene.index.CorruptIndexException;
+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.Term;
-import org.apache.lucene.index.IndexWriterConfig.OpenMode;
 import org.apache.lucene.search.IndexSearcher;
 import org.apache.lucene.search.spans.SpanFirstQuery;
 import org.apache.lucene.search.spans.SpanMultiTermQueryWrapper;
 import org.apache.lucene.search.spans.SpanQuery;
 import org.apache.lucene.store.Directory;
-import org.apache.lucene.store.LockObtainFailedException;
 import org.apache.lucene.util.LuceneTestCase;
 
 public class TestSpanRegexQuery extends LuceneTestCase {
@@ -65,10 +60,10 @@ public class TestSpanRegexQuery extends 
     // Field.Store.NO, Field.Index.ANALYZED));
     // writer.addDocument(doc);
     // doc = new Document();
-    doc.add(newField("field", "auto update", TextField.TYPE_UNSTORED));
+    doc.add(newTextField("field", "auto update", Field.Store.NO));
     writer.addDocument(doc);
     doc = new Document();
-    doc.add(newField("field", "first auto update", TextField.TYPE_UNSTORED));
+    doc.add(newTextField("field", "first auto update", Field.Store.NO));
     writer.addDocument(doc);
     writer.forceMerge(1);
     writer.close();

Modified: lucene/dev/branches/branch_4x/lucene/spatial/src/java/org/apache/lucene/spatial/prefix/PrefixTreeStrategy.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/branch_4x/lucene/spatial/src/java/org/apache/lucene/spatial/prefix/PrefixTreeStrategy.java?rev=1348639&r1=1348638&r2=1348639&view=diff
==============================================================================
--- lucene/dev/branches/branch_4x/lucene/spatial/src/java/org/apache/lucene/spatial/prefix/PrefixTreeStrategy.java (original)
+++ lucene/dev/branches/branch_4x/lucene/spatial/src/java/org/apache/lucene/spatial/prefix/PrefixTreeStrategy.java Sun Jun 10 18:27:08 2012
@@ -87,23 +87,23 @@ public abstract class PrefixTreeStrategy
     }
     
     if( index ) {
-      return new Field(fname,new CellTokenStream(cells.iterator()),TYPE_UNSTORED);
+      return new Field(fname,new CellTokenStream(cells.iterator()),TYPE_NOT_STORED);
     }
     
     throw new UnsupportedOperationException("Fields need to be indexed or store ["+fname+"]");
   }
 
   /* Indexed, tokenized, not stored. */
-  public static final FieldType TYPE_UNSTORED = new FieldType();
+  public static final FieldType TYPE_NOT_STORED = new FieldType();
 
   /* Indexed, tokenized, stored. */
   public static final FieldType TYPE_STORED = new FieldType();
 
   static {
-    TYPE_UNSTORED.setIndexed(true);
-    TYPE_UNSTORED.setTokenized(true);
-    TYPE_UNSTORED.setOmitNorms(true);
-    TYPE_UNSTORED.freeze();
+    TYPE_NOT_STORED.setIndexed(true);
+    TYPE_NOT_STORED.setTokenized(true);
+    TYPE_NOT_STORED.setOmitNorms(true);
+    TYPE_NOT_STORED.freeze();
 
     TYPE_STORED.setStored(true);
     TYPE_STORED.setIndexed(true);

Modified: lucene/dev/branches/branch_4x/lucene/spatial/src/java/org/apache/lucene/spatial/util/NumericFieldInfo.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/branch_4x/lucene/spatial/src/java/org/apache/lucene/spatial/util/NumericFieldInfo.java?rev=1348639&r1=1348638&r2=1348639&view=diff
==============================================================================
--- lucene/dev/branches/branch_4x/lucene/spatial/src/java/org/apache/lucene/spatial/util/NumericFieldInfo.java (original)
+++ lucene/dev/branches/branch_4x/lucene/spatial/src/java/org/apache/lucene/spatial/util/NumericFieldInfo.java Sun Jun 10 18:27:08 2012
@@ -39,7 +39,7 @@ public class NumericFieldInfo {
     if (!store && !index)
       throw new IllegalArgumentException("field must be indexed or stored");
 
-    FieldType fieldType = new FieldType(DoubleField.TYPE);
+    FieldType fieldType = new FieldType(DoubleField.TYPE_NOT_STORED);
     fieldType.setStored(store);
     fieldType.setIndexed(index);
     fieldType.setNumericPrecisionStep(precisionStep);

Modified: lucene/dev/branches/branch_4x/lucene/spatial/src/test/org/apache/lucene/spatial/StrategyTestCase.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/branch_4x/lucene/spatial/src/test/org/apache/lucene/spatial/StrategyTestCase.java?rev=1348639&r1=1348638&r2=1348639&view=diff
==============================================================================
--- lucene/dev/branches/branch_4x/lucene/spatial/src/test/org/apache/lucene/spatial/StrategyTestCase.java (original)
+++ lucene/dev/branches/branch_4x/lucene/spatial/src/test/org/apache/lucene/spatial/StrategyTestCase.java Sun Jun 10 18:27:08 2012
@@ -76,8 +76,8 @@ public abstract class StrategyTestCase<T
     while (sampleData.hasNext()) {
       SampleData data = sampleData.next();
       Document document = new Document();
-      document.add(new Field("id", data.id, StringField.TYPE_STORED));
-      document.add(new Field("name", data.name, StringField.TYPE_STORED));
+      document.add(new StringField("id", data.id, Field.Store.YES));
+      document.add(new StringField("name", data.name, Field.Store.YES));
       Shape shape = ctx.readShape(data.shape);
       for (IndexableField f : strategy.createFields(fieldInfo, shape, true, storeShape)) {
         if( f != null ) { // null if incompatibleGeometry && ignore

Modified: lucene/dev/branches/branch_4x/lucene/spatial/src/test/org/apache/lucene/spatial/prefix/TestTermQueryPrefixGridStrategy.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/branch_4x/lucene/spatial/src/test/org/apache/lucene/spatial/prefix/TestTermQueryPrefixGridStrategy.java?rev=1348639&r1=1348638&r2=1348639&view=diff
==============================================================================
--- lucene/dev/branches/branch_4x/lucene/spatial/src/test/org/apache/lucene/spatial/prefix/TestTermQueryPrefixGridStrategy.java (original)
+++ lucene/dev/branches/branch_4x/lucene/spatial/src/test/org/apache/lucene/spatial/prefix/TestTermQueryPrefixGridStrategy.java Sun Jun 10 18:27:08 2012
@@ -45,7 +45,7 @@ public class TestTermQueryPrefixGridStra
     Shape point = new PointImpl(-118.243680, 34.052230);
 
     Document losAngeles = new Document();
-    losAngeles.add(new Field("name", "Los Angeles", StringField.TYPE_STORED));
+    losAngeles.add(new StringField("name", "Los Angeles", Field.Store.YES));
     losAngeles.add(prefixGridStrategy.createField(fieldInfo, point, true, true));
 
     addDocumentsAndCommit(Arrays.asList(losAngeles));

Modified: lucene/dev/branches/branch_4x/lucene/suggest/src/java/org/apache/lucene/search/spell/SpellChecker.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/branch_4x/lucene/suggest/src/java/org/apache/lucene/search/spell/SpellChecker.java?rev=1348639&r1=1348638&r2=1348639&view=diff
==============================================================================
--- lucene/dev/branches/branch_4x/lucene/suggest/src/java/org/apache/lucene/search/spell/SpellChecker.java (original)
+++ lucene/dev/branches/branch_4x/lucene/suggest/src/java/org/apache/lucene/search/spell/SpellChecker.java Sun Jun 10 18:27:08 2012
@@ -20,7 +20,6 @@ package org.apache.lucene.search.spell;
 import java.io.IOException;
 import java.util.ArrayList;
 import java.util.Comparator;
-import java.util.Iterator;
 import java.util.List;
 
 import org.apache.lucene.document.Document;
@@ -575,7 +574,7 @@ public class SpellChecker implements jav
     Document doc = new Document();
     // the word field is never queried on... its indexed so it can be quickly
     // checked for rebuild (and stored for retrieval). Doesn't need norms or TF/pos
-    Field f = new Field(F_WORD, text, StringField.TYPE_STORED);
+    Field f = new StringField(F_WORD, text, Field.Store.YES);
     doc.add(f); // orig term
     addGram(text, doc, ng1, ng2);
     return doc;
@@ -588,7 +587,7 @@ public class SpellChecker implements jav
       String end = null;
       for (int i = 0; i < len - ng + 1; i++) {
         String gram = text.substring(i, i + ng);
-        FieldType ft = new FieldType(StringField.TYPE_UNSTORED);
+        FieldType ft = new FieldType(StringField.TYPE_NOT_STORED);
         ft.setIndexOptions(IndexOptions.DOCS_AND_FREQS);
         Field ngramField = new Field(key, gram, ft);
         // spellchecker does not use positional queries, but we want freqs
@@ -596,14 +595,14 @@ public class SpellChecker implements jav
         doc.add(ngramField);
         if (i == 0) {
           // only one term possible in the startXXField, TF/pos and norms aren't needed.
-          Field startField = new StringField("start" + ng, gram);
+          Field startField = new StringField("start" + ng, gram, Field.Store.NO);
           doc.add(startField);
         }
         end = gram;
       }
       if (end != null) { // may not be present if len==ng1
         // only one term possible in the endXXField, TF/pos and norms aren't needed.
-        Field endField = new StringField("end" + ng, end);
+        Field endField = new StringField("end" + ng, end, Field.Store.NO);
         doc.add(endField);
       }
     }

Modified: lucene/dev/branches/branch_4x/lucene/suggest/src/test/org/apache/lucene/search/spell/TestDirectSpellChecker.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/branch_4x/lucene/suggest/src/test/org/apache/lucene/search/spell/TestDirectSpellChecker.java?rev=1348639&r1=1348638&r2=1348639&view=diff
==============================================================================
--- lucene/dev/branches/branch_4x/lucene/suggest/src/test/org/apache/lucene/search/spell/TestDirectSpellChecker.java (original)
+++ lucene/dev/branches/branch_4x/lucene/suggest/src/test/org/apache/lucene/search/spell/TestDirectSpellChecker.java Sun Jun 10 18:27:08 2012
@@ -20,7 +20,7 @@ package org.apache.lucene.search.spell;
 import org.apache.lucene.analysis.MockAnalyzer;
 import org.apache.lucene.analysis.MockTokenizer;
 import org.apache.lucene.document.Document;
-import org.apache.lucene.document.TextField;
+import org.apache.lucene.document.Field;
 import org.apache.lucene.index.IndexReader;
 import org.apache.lucene.index.RandomIndexWriter;
 import org.apache.lucene.index.Term;
@@ -39,7 +39,7 @@ public class TestDirectSpellChecker exte
     String[] termsToAdd = { "metanoia", "metanoian", "metanoiai", "metanoias", "metanoi𐑍" };
     for (int i = 0; i < termsToAdd.length; i++) {
       Document doc = new Document();
-      doc.add(newField("repentance", termsToAdd[i], TextField.TYPE_UNSTORED));
+      doc.add(newTextField("repentance", termsToAdd[i], Field.Store.NO));
       writer.addDocument(doc);
     }
 
@@ -68,7 +68,7 @@ public class TestDirectSpellChecker exte
 
     for (int i = 0; i < 20; i++) {
       Document doc = new Document();
-      doc.add(newField("numbers", English.intToEnglish(i), TextField.TYPE_UNSTORED));
+      doc.add(newTextField("numbers", English.intToEnglish(i), Field.Store.NO));
       writer.addDocument(doc);
     }
 
@@ -108,7 +108,7 @@ public class TestDirectSpellChecker exte
     // add some more documents
     for (int i = 1000; i < 1100; i++) {
       Document doc = new Document();
-      doc.add(newField("numbers", English.intToEnglish(i), TextField.TYPE_UNSTORED));
+      doc.add(newTextField("numbers", English.intToEnglish(i), Field.Store.NO));
       writer.addDocument(doc);
     }
 
@@ -132,13 +132,13 @@ public class TestDirectSpellChecker exte
         new MockAnalyzer(random(), MockTokenizer.SIMPLE, true));
 
     Document doc = new Document();
-    doc.add(newField("text", "foobar", TextField.TYPE_UNSTORED));
+    doc.add(newTextField("text", "foobar", Field.Store.NO));
     writer.addDocument(doc);
-    doc.add(newField("text", "foobar", TextField.TYPE_UNSTORED));
+    doc.add(newTextField("text", "foobar", Field.Store.NO));
     writer.addDocument(doc);
-    doc.add(newField("text", "foobaz", TextField.TYPE_UNSTORED));
+    doc.add(newTextField("text", "foobaz", Field.Store.NO));
     writer.addDocument(doc);
-    doc.add(newField("text", "fobar", TextField.TYPE_UNSTORED));
+    doc.add(newTextField("text", "fobar", Field.Store.NO));
     writer.addDocument(doc);
    
     IndexReader ir = writer.getReader();
@@ -200,7 +200,7 @@ public class TestDirectSpellChecker exte
 
     for (int i = 0; i < 20; i++) {
       Document doc = new Document();
-      doc.add(newField("numbers", English.intToEnglish(i), TextField.TYPE_UNSTORED));
+      doc.add(newTextField("numbers", English.intToEnglish(i), Field.Store.NO));
       writer.addDocument(doc);
     }
 
@@ -224,7 +224,7 @@ public class TestDirectSpellChecker exte
 
     for (int i = 0; i < 20; i++) {
       Document doc = new Document();
-      doc.add(newField("numbers", English.intToEnglish(i), TextField.TYPE_UNSTORED));
+      doc.add(newTextField("numbers", English.intToEnglish(i), Field.Store.NO));
       writer.addDocument(doc);
     }
 
@@ -249,7 +249,7 @@ public class TestDirectSpellChecker exte
 
     for (int i = 0; i < 20; i++) {
       Document doc = new Document();
-      doc.add(newField("numbers", English.intToEnglish(i), TextField.TYPE_UNSTORED));
+      doc.add(newTextField("numbers", English.intToEnglish(i), Field.Store.NO));
       writer.addDocument(doc);
     }
 

Modified: lucene/dev/branches/branch_4x/lucene/suggest/src/test/org/apache/lucene/search/spell/TestLuceneDictionary.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/branch_4x/lucene/suggest/src/test/org/apache/lucene/search/spell/TestLuceneDictionary.java?rev=1348639&r1=1348638&r2=1348639&view=diff
==============================================================================
--- lucene/dev/branches/branch_4x/lucene/suggest/src/test/org/apache/lucene/search/spell/TestLuceneDictionary.java (original)
+++ lucene/dev/branches/branch_4x/lucene/suggest/src/test/org/apache/lucene/search/spell/TestLuceneDictionary.java Sun Jun 10 18:27:08 2012
@@ -22,7 +22,7 @@ import java.io.IOException;
 import org.apache.lucene.analysis.MockAnalyzer;
 import org.apache.lucene.analysis.MockTokenizer;
 import org.apache.lucene.document.Document;
-import org.apache.lucene.document.TextField;
+import org.apache.lucene.document.Field;
 import org.apache.lucene.index.DirectoryReader;
 import org.apache.lucene.index.IndexReader;
 import org.apache.lucene.index.IndexWriter;
@@ -54,23 +54,23 @@ public class TestLuceneDictionary extend
     Document doc;
 
     doc = new  Document();
-    doc.add(newField("aaa", "foo", TextField.TYPE_STORED));
+    doc.add(newTextField("aaa", "foo", Field.Store.YES));
     writer.addDocument(doc);
 
     doc = new  Document();
-    doc.add(newField("aaa", "foo", TextField.TYPE_STORED));
+    doc.add(newTextField("aaa", "foo", Field.Store.YES));
     writer.addDocument(doc);
 
     doc = new  Document();
-    doc.add(newField("contents", "Tom", TextField.TYPE_STORED));
+    doc.add(newTextField("contents", "Tom", Field.Store.YES));
     writer.addDocument(doc);
 
     doc = new  Document();
-    doc.add(newField("contents", "Jerry", TextField.TYPE_STORED));
+    doc.add(newTextField("contents", "Jerry", Field.Store.YES));
     writer.addDocument(doc);
 
     doc = new Document();
-    doc.add(newField("zzz", "bar", TextField.TYPE_STORED));
+    doc.add(newTextField("zzz", "bar", Field.Store.YES));
     writer.addDocument(doc);
 
     writer.forceMerge(1);

Modified: lucene/dev/branches/branch_4x/lucene/suggest/src/test/org/apache/lucene/search/spell/TestSpellChecker.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/branch_4x/lucene/suggest/src/test/org/apache/lucene/search/spell/TestSpellChecker.java?rev=1348639&r1=1348638&r2=1348639&view=diff
==============================================================================
--- lucene/dev/branches/branch_4x/lucene/suggest/src/test/org/apache/lucene/search/spell/TestSpellChecker.java (original)
+++ lucene/dev/branches/branch_4x/lucene/suggest/src/test/org/apache/lucene/search/spell/TestSpellChecker.java Sun Jun 10 18:27:08 2012
@@ -28,7 +28,7 @@ import java.util.concurrent.TimeUnit;
 
 import org.apache.lucene.analysis.MockAnalyzer;
 import org.apache.lucene.document.Document;
-import org.apache.lucene.document.TextField;
+import org.apache.lucene.document.Field;
 import org.apache.lucene.index.CorruptIndexException;
 import org.apache.lucene.index.DirectoryReader;
 import org.apache.lucene.index.IndexReader;
@@ -59,14 +59,14 @@ public class TestSpellChecker extends Lu
 
     for (int i = 0; i < 1000; i++) {
       Document doc = new Document();
-      doc.add(newField("field1", English.intToEnglish(i), TextField.TYPE_STORED));
-      doc.add(newField("field2", English.intToEnglish(i + 1), TextField.TYPE_STORED)); // + word thousand
-      doc.add(newField("field3", "fvei" + (i % 2 == 0 ? " five" : ""), TextField.TYPE_STORED)); // + word thousand
+      doc.add(newTextField("field1", English.intToEnglish(i), Field.Store.YES));
+      doc.add(newTextField("field2", English.intToEnglish(i + 1), Field.Store.YES)); // + word thousand
+      doc.add(newTextField("field3", "fvei" + (i % 2 == 0 ? " five" : ""), Field.Store.YES)); // + word thousand
       writer.addDocument(doc);
     }
     {
       Document doc = new Document();
-      doc.add(newField("field1", "eight", TextField.TYPE_STORED)); // "eight" in
+      doc.add(newTextField("field1", "eight", Field.Store.YES)); // "eight" in
                                                                    // the index
                                                                    // twice
       writer.addDocument(doc);
@@ -74,13 +74,12 @@ public class TestSpellChecker extends Lu
     {
       Document doc = new Document();
       doc
-          .add(newField("field1", "twenty-one twenty-one",
-              TextField.TYPE_STORED)); // "twenty-one" in the index thrice
+          .add(newTextField("field1", "twenty-one twenty-one", Field.Store.YES)); // "twenty-one" in the index thrice
       writer.addDocument(doc);
     }
     {
       Document doc = new Document();
-      doc.add(newField("field1", "twenty", TextField.TYPE_STORED)); // "twenty"
+      doc.add(newTextField("field1", "twenty", Field.Store.YES)); // "twenty"
                                                                     // in the
                                                                     // index
                                                                     // twice

Modified: lucene/dev/branches/branch_4x/lucene/suggest/src/test/org/apache/lucene/search/spell/TestWordBreakSpellChecker.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/branch_4x/lucene/suggest/src/test/org/apache/lucene/search/spell/TestWordBreakSpellChecker.java?rev=1348639&r1=1348638&r2=1348639&view=diff
==============================================================================
--- lucene/dev/branches/branch_4x/lucene/suggest/src/test/org/apache/lucene/search/spell/TestWordBreakSpellChecker.java (original)
+++ lucene/dev/branches/branch_4x/lucene/suggest/src/test/org/apache/lucene/search/spell/TestWordBreakSpellChecker.java Sun Jun 10 18:27:08 2012
@@ -22,7 +22,7 @@ import junit.framework.Assert;
 import org.apache.lucene.analysis.MockAnalyzer;
 import org.apache.lucene.analysis.MockTokenizer;
 import org.apache.lucene.document.Document;
-import org.apache.lucene.document.TextField;
+import org.apache.lucene.document.Field;
 import org.apache.lucene.index.DirectoryReader;
 import org.apache.lucene.index.IndexReader;
 import org.apache.lucene.index.RandomIndexWriter;
@@ -44,23 +44,23 @@ public class TestWordBreakSpellChecker e
     for (int i = 900; i < 1112; i++) {
       Document doc = new Document();
       String num = English.intToEnglish(i).replaceAll("[-]", " ").replaceAll("[,]", "");
-      doc.add(newField("numbers", num, TextField.TYPE_UNSTORED));
+      doc.add(newTextField("numbers", num, Field.Store.NO));
       writer.addDocument(doc);
     }
     
     {
       Document doc = new Document();
-      doc.add(newField("numbers", "thou hast sand betwixt thy toes", TextField.TYPE_UNSTORED));
+      doc.add(newTextField("numbers", "thou hast sand betwixt thy toes", Field.Store.NO));
       writer.addDocument(doc);
     }
     {
       Document doc = new Document();
-      doc.add(newField("numbers", "hundredeight eightyeight yeight", TextField.TYPE_UNSTORED));
+      doc.add(newTextField("numbers", "hundredeight eightyeight yeight", Field.Store.NO));
       writer.addDocument(doc);
     }
     {
       Document doc = new Document();
-      doc.add(newField("numbers", "tres y cinco", TextField.TYPE_UNSTORED));
+      doc.add(newTextField("numbers", "tres y cinco", Field.Store.NO));
       writer.addDocument(doc);
     }
     

Modified: lucene/dev/branches/branch_4x/lucene/test-framework/src/java/org/apache/lucene/analysis/CollationTestBase.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/branch_4x/lucene/test-framework/src/java/org/apache/lucene/analysis/CollationTestBase.java?rev=1348639&r1=1348638&r2=1348639&view=diff
==============================================================================
--- lucene/dev/branches/branch_4x/lucene/test-framework/src/java/org/apache/lucene/analysis/CollationTestBase.java (original)
+++ lucene/dev/branches/branch_4x/lucene/test-framework/src/java/org/apache/lucene/analysis/CollationTestBase.java Sun Jun 10 18:27:08 2012
@@ -85,8 +85,8 @@ public abstract class CollationTestBase 
     IndexWriter writer = new IndexWriter(dir, new IndexWriterConfig(
         TEST_VERSION_CURRENT, analyzer));
     Document doc = new Document();
-    doc.add(new Field("content", "\u0633\u0627\u0628", TextField.TYPE_STORED));
-    doc.add(new Field("body", "body", StringField.TYPE_STORED));
+    doc.add(new TextField("content", "\u0633\u0627\u0628", Field.Store.YES));
+    doc.add(new StringField("body", "body", Field.Store.YES));
     writer.addDocument(doc);
     writer.close();
     IndexReader reader = DirectoryReader.open(dir);
@@ -122,7 +122,7 @@ public abstract class CollationTestBase 
     // orders the U+0698 character before the U+0633 character, so the single
     // index Term below should NOT be returned by a TermRangeQuery with a Farsi
     // Collator (or an Arabic one for the case when Farsi is not supported).
-    doc.add(new Field("content", "\u0633\u0627\u0628", TextField.TYPE_STORED));
+    doc.add(new TextField("content", "\u0633\u0627\u0628", Field.Store.YES));
     writer.addDocument(doc);
     writer.close();
     IndexReader reader = DirectoryReader.open(dir);
@@ -146,8 +146,8 @@ public abstract class CollationTestBase 
     IndexWriter writer = new IndexWriter(farsiIndex, new IndexWriterConfig(
         TEST_VERSION_CURRENT, analyzer));
     Document doc = new Document();
-    doc.add(new Field("content", "\u0633\u0627\u0628", TextField.TYPE_STORED));
-    doc.add(new Field("body", "body", StringField.TYPE_STORED));
+    doc.add(new TextField("content", "\u0633\u0627\u0628", Field.Store.YES));
+    doc.add(new StringField("body", "body", Field.Store.YES));
     writer.addDocument(doc);
     writer.close();
 
@@ -214,7 +214,7 @@ public abstract class CollationTestBase 
     for (int i = 0 ; i < sortData.length ; ++i) {
       Document doc = new Document();
       doc.add(new Field("tracer", sortData[i][0], customType));
-      doc.add(new TextField("contents", sortData[i][1]));
+      doc.add(new TextField("contents", sortData[i][1], Field.Store.NO));
       if (sortData[i][2] != null) 
         doc.add(new TextField("US", usAnalyzer.tokenStream("US", new StringReader(sortData[i][2]))));
       if (sortData[i][3] != null) 

Modified: lucene/dev/branches/branch_4x/lucene/test-framework/src/java/org/apache/lucene/index/DocHelper.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/branch_4x/lucene/test-framework/src/java/org/apache/lucene/index/DocHelper.java?rev=1348639&r1=1348638&r2=1348639&view=diff
==============================================================================
--- lucene/dev/branches/branch_4x/lucene/test-framework/src/java/org/apache/lucene/index/DocHelper.java (original)
+++ lucene/dev/branches/branch_4x/lucene/test-framework/src/java/org/apache/lucene/index/DocHelper.java Sun Jun 10 18:27:08 2012
@@ -78,7 +78,7 @@ class DocHelper {
   public static final String KEYWORD_FIELD_KEY = "keyField";
   public static Field keyField;
   static {
-    keyField = new Field(KEYWORD_FIELD_KEY, KEYWORD_TEXT, StringField.TYPE_STORED);
+    keyField = new StringField(KEYWORD_FIELD_KEY, KEYWORD_TEXT, Field.Store.YES);
   }
 
   public static final FieldType customType5;
@@ -115,14 +115,14 @@ class DocHelper {
 
   public static final String UNSTORED_1_FIELD_TEXT = "unstored field text";
   public static final String UNSTORED_FIELD_1_KEY = "unStoredField1";
-  public static Field unStoredField1 = new Field(UNSTORED_FIELD_1_KEY, UNSTORED_1_FIELD_TEXT, TextField.TYPE_UNSTORED);
+  public static Field unStoredField1 = new TextField(UNSTORED_FIELD_1_KEY, UNSTORED_1_FIELD_TEXT, Field.Store.NO);
 
   public static final FieldType customType8;
   public static final String UNSTORED_2_FIELD_TEXT = "unstored field text";
   public static final String UNSTORED_FIELD_2_KEY = "unStoredField2";
   public static Field unStoredField2;
   static {
-    customType8 = new FieldType(TextField.TYPE_UNSTORED);
+    customType8 = new FieldType(TextField.TYPE_NOT_STORED);
     customType8.setStoreTermVectors(true);
     unStoredField2 = new Field(UNSTORED_FIELD_2_KEY, UNSTORED_2_FIELD_TEXT, customType8);
   }

Modified: lucene/dev/branches/branch_4x/lucene/test-framework/src/java/org/apache/lucene/index/ThreadedIndexingAndSearchingTestCase.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/branch_4x/lucene/test-framework/src/java/org/apache/lucene/index/ThreadedIndexingAndSearchingTestCase.java?rev=1348639&r1=1348638&r2=1348639&view=diff
==============================================================================
--- lucene/dev/branches/branch_4x/lucene/test-framework/src/java/org/apache/lucene/index/ThreadedIndexingAndSearchingTestCase.java (original)
+++ lucene/dev/branches/branch_4x/lucene/test-framework/src/java/org/apache/lucene/index/ThreadedIndexingAndSearchingTestCase.java Sun Jun 10 18:27:08 2012
@@ -29,8 +29,6 @@ import java.util.concurrent.atomic.Atomi
 import org.apache.lucene.analysis.MockAnalyzer;
 import org.apache.lucene.document.Document;
 import org.apache.lucene.document.Field;
-import org.apache.lucene.document.StringField;
-import org.apache.lucene.document.TextField;
 import org.apache.lucene.search.IndexSearcher;
 import org.apache.lucene.search.PhraseQuery;
 import org.apache.lucene.search.Query;
@@ -158,7 +156,7 @@ public abstract class ThreadedIndexingAn
                 final String addedField;
                 if (random().nextBoolean()) {
                   addedField = "extra" + random().nextInt(40);
-                  doc.add(newField(addedField, "a random field", TextField.TYPE_STORED));
+                  doc.add(newTextField(addedField, "a random field", Field.Store.YES));
                 } else {
                   addedField = null;
                 }
@@ -181,7 +179,7 @@ public abstract class ThreadedIndexingAn
                       packID = packCount.getAndIncrement() + "";
                     }
 
-                    final Field packIDField = newField("packID", packID, StringField.TYPE_STORED);
+                    final Field packIDField = newStringField("packID", packID, Field.Store.YES);
                     final List<String> docIDs = new ArrayList<String>();
                     final SubDocs subDocs = new SubDocs(packID, docIDs);
                     final List<Document> docsList = new ArrayList<Document>();

Modified: lucene/dev/branches/branch_4x/lucene/test-framework/src/java/org/apache/lucene/search/SearchEquivalenceTestBase.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/branch_4x/lucene/test-framework/src/java/org/apache/lucene/search/SearchEquivalenceTestBase.java?rev=1348639&r1=1348638&r2=1348639&view=diff
==============================================================================
--- lucene/dev/branches/branch_4x/lucene/test-framework/src/java/org/apache/lucene/search/SearchEquivalenceTestBase.java (original)
+++ lucene/dev/branches/branch_4x/lucene/test-framework/src/java/org/apache/lucene/search/SearchEquivalenceTestBase.java Sun Jun 10 18:27:08 2012
@@ -62,8 +62,8 @@ public abstract class SearchEquivalenceT
     analyzer = new MockAnalyzer(random, MockTokenizer.WHITESPACE, false, stopset, true);
     RandomIndexWriter iw = new RandomIndexWriter(random, directory, analyzer);
     Document doc = new Document();
-    Field id = new StringField("id", "");
-    Field field = new TextField("field", "");
+    Field id = new StringField("id", "", Field.Store.NO);
+    Field field = new TextField("field", "", Field.Store.NO);
     doc.add(id);
     doc.add(field);
     

Modified: lucene/dev/branches/branch_4x/lucene/test-framework/src/java/org/apache/lucene/util/LineFileDocs.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/branch_4x/lucene/test-framework/src/java/org/apache/lucene/util/LineFileDocs.java?rev=1348639&r1=1348638&r2=1348639&view=diff
==============================================================================
--- lucene/dev/branches/branch_4x/lucene/test-framework/src/java/org/apache/lucene/util/LineFileDocs.java (original)
+++ lucene/dev/branches/branch_4x/lucene/test-framework/src/java/org/apache/lucene/util/LineFileDocs.java Sun Jun 10 18:27:08 2012
@@ -162,7 +162,7 @@ public class LineFileDocs implements Clo
     public DocState(boolean useDocValues) {
       doc = new Document();
       
-      title = new StringField("title", "");
+      title = new StringField("title", "", Field.Store.NO);
       doc.add(title);
 
       FieldType ft = new FieldType(TextField.TYPE_STORED);
@@ -176,10 +176,10 @@ public class LineFileDocs implements Clo
       body = new Field("body", "", ft);
       doc.add(body);
 
-      id = new Field("docid", "", StringField.TYPE_STORED);
+      id = new StringField("docid", "", Field.Store.YES);
       doc.add(id);
 
-      date = new Field("date", "", StringField.TYPE_STORED);
+      date = new StringField("date", "", Field.Store.YES);
       doc.add(date);
 
       if (useDocValues) {

Modified: lucene/dev/branches/branch_4x/lucene/test-framework/src/java/org/apache/lucene/util/LuceneTestCase.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/branch_4x/lucene/test-framework/src/java/org/apache/lucene/util/LuceneTestCase.java?rev=1348639&r1=1348638&r2=1348639&view=diff
==============================================================================
--- lucene/dev/branches/branch_4x/lucene/test-framework/src/java/org/apache/lucene/util/LuceneTestCase.java (original)
+++ lucene/dev/branches/branch_4x/lucene/test-framework/src/java/org/apache/lucene/util/LuceneTestCase.java Sun Jun 10 18:27:08 2012
@@ -17,9 +17,6 @@ package org.apache.lucene.util;
  * limitations under the License.
  */
 
-import static com.carrotsearch.randomizedtesting.RandomizedTest.systemPropertyAsBoolean;
-import static com.carrotsearch.randomizedtesting.RandomizedTest.systemPropertyAsInt;
-
 import java.io.*;
 import java.lang.annotation.*;
 import java.lang.reflect.Constructor;
@@ -29,8 +26,11 @@ import java.util.concurrent.*;
 
 import org.apache.lucene.analysis.Analyzer;
 import org.apache.lucene.codecs.Codec;
+import org.apache.lucene.document.Field.Store;
 import org.apache.lucene.document.Field;
 import org.apache.lucene.document.FieldType;
+import org.apache.lucene.document.StringField;
+import org.apache.lucene.document.TextField;
 import org.apache.lucene.index.*;
 import org.apache.lucene.index.IndexReader.ReaderClosedListener;
 import org.apache.lucene.search.*;
@@ -43,12 +43,14 @@ import org.junit.*;
 import org.junit.rules.RuleChain;
 import org.junit.rules.TestRule;
 import org.junit.runner.RunWith;
-
 import com.carrotsearch.randomizedtesting.*;
 import com.carrotsearch.randomizedtesting.annotations.*;
 import com.carrotsearch.randomizedtesting.generators.RandomPicks;
 import com.carrotsearch.randomizedtesting.rules.SystemPropertiesInvariantRule;
 
+import static com.carrotsearch.randomizedtesting.RandomizedTest.systemPropertyAsBoolean;
+import static com.carrotsearch.randomizedtesting.RandomizedTest.systemPropertyAsInt;
+
 /**
  * Base class for all Lucene unit tests, Junit3 or Junit4 variant.
  * 
@@ -842,6 +844,22 @@ public abstract class LuceneTestCase ext
     }
   }
   
+  public static Field newStringField(String name, String value, Store stored) {
+    return newField(random(), name, value, stored == Store.YES ? StringField.TYPE_STORED : StringField.TYPE_NOT_STORED);
+  }
+
+  public static Field newTextField(String name, String value, Store stored) {
+    return newField(random(), name, value, stored == Store.YES ? TextField.TYPE_STORED : TextField.TYPE_NOT_STORED);
+  }
+  
+  public static Field newStringField(Random random, String name, String value, Store stored) {
+    return newField(random, name, value, stored == Store.YES ? StringField.TYPE_STORED : StringField.TYPE_NOT_STORED);
+  }
+  
+  public static Field newTextField(Random random, String name, String value, Store stored) {
+    return newField(random, name, value, stored == Store.YES ? TextField.TYPE_STORED : TextField.TYPE_NOT_STORED);
+  }
+  
   public static Field newField(String name, String value, FieldType type) {
     return newField(random(), name, value, type);
   }

Modified: lucene/dev/branches/branch_4x/solr/core/src/java/org/apache/solr/handler/component/QueryComponent.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/branch_4x/solr/core/src/java/org/apache/solr/handler/component/QueryComponent.java?rev=1348639&r1=1348638&r2=1348639&view=diff
==============================================================================
--- lucene/dev/branches/branch_4x/solr/core/src/java/org/apache/solr/handler/component/QueryComponent.java (original)
+++ lucene/dev/branches/branch_4x/solr/core/src/java/org/apache/solr/handler/component/QueryComponent.java Sun Jun 10 18:27:08 2012
@@ -435,7 +435,7 @@ public class QueryComponent extends Sear
       Sort sort = searcher.weightSort(rb.getSortSpec().getSort());
       SortField[] sortFields = sort==null ? new SortField[]{SortField.FIELD_SCORE} : sort.getSort();
       NamedList<Object[]> sortVals = new NamedList<Object[]>(); // order is important for the sort fields
-      Field field = new StringField("dummy", ""); // a dummy Field
+      Field field = new StringField("dummy", "", Field.Store.NO); // a dummy Field
       IndexReaderContext topReaderContext = searcher.getTopReaderContext();
       AtomicReaderContext[] leaves = topReaderContext.leaves();
       AtomicReaderContext currentLeaf = null;



Mime
View raw message