diff --git a/src/test/org/apache/lucene/document/TestDocument.java b/src/test/org/apache/lucene/document/TestDocument.java index 37ad47da0fd..0f1c96e663a 100644 --- a/src/test/org/apache/lucene/document/TestDocument.java +++ b/src/test/org/apache/lucene/document/TestDocument.java @@ -140,14 +140,14 @@ public class TestDocument extends TestCase private Document makeDocumentWithFields() { Document doc = new Document(); - doc.add(Field.Keyword( "keyword", "test1")); - doc.add(Field.Keyword( "keyword", "test2")); + doc.add(new Field( "keyword", "test1", Field.Store.YES, Field.Index.UN_TOKENIZED)); + doc.add(new Field( "keyword", "test2", Field.Store.YES, Field.Index.UN_TOKENIZED)); doc.add(new Field( "text", "test1", Field.Store.YES, Field.Index.TOKENIZED)); doc.add(new Field( "text", "test2", Field.Store.YES, Field.Index.TOKENIZED)); - doc.add(Field.UnIndexed("unindexed", "test1")); - doc.add(Field.UnIndexed("unindexed", "test2")); - doc.add(Field.UnStored( "unstored", "test1")); - doc.add(Field.UnStored( "unstored", "test2")); + doc.add(new Field("unindexed", "test1", Field.Store.YES, Field.Index.NO)); + doc.add(new Field("unindexed", "test2", Field.Store.YES, Field.Index.NO)); + doc.add(new Field( "unstored", "test1", Field.Store.NO, Field.Index.TOKENIZED)); + doc.add(new Field( "unstored", "test2", Field.Store.NO, Field.Index.TOKENIZED)); return doc; } diff --git a/src/test/org/apache/lucene/search/TestDateFilter.java b/src/test/org/apache/lucene/search/TestDateFilter.java index c1a8df40339..702e9d440b5 100644 --- a/src/test/org/apache/lucene/search/TestDateFilter.java +++ b/src/test/org/apache/lucene/search/TestDateFilter.java @@ -59,8 +59,8 @@ public class TestDateFilter Document doc = new Document(); // add time that is in the past - doc.add(Field.Keyword("datefield", DateField.timeToString(now - 1000))); - doc.add(Field.Text("body", "Today is a very sunny day in New York City")); + doc.add(new Field("datefield", DateField.timeToString(now - 1000), Field.Store.YES, Field.Index.UN_TOKENIZED)); + doc.add(new Field("body", "Today is a very sunny day in New York City", Field.Store.YES, Field.Index.TOKENIZED)); writer.addDocument(doc); writer.optimize(); writer.close(); @@ -117,8 +117,8 @@ public class TestDateFilter Document doc = new Document(); // add time that is in the future - doc.add(Field.Keyword("datefield", DateField.timeToString(now + 888888))); - doc.add(Field.Text("body", "Today is a very sunny day in New York City")); + doc.add(new Field("datefield", DateField.timeToString(now + 888888), Field.Store.YES, Field.Index.UN_TOKENIZED)); + doc.add(new Field("body", "Today is a very sunny day in New York City", Field.Store.YES, Field.Index.TOKENIZED)); writer.addDocument(doc); writer.optimize(); writer.close();