lucene-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dna...@apache.org
Subject cvs commit: jakarta-lucene/src/test/org/apache/lucene/search TestDateFilter.java
Date Sun, 05 Sep 2004 22:27:42 GMT
dnaber      2004/09/05 15:27:42

  Modified:    src/test/org/apache/lucene/document TestDocument.java
               src/test/org/apache/lucene/search TestDateFilter.java
  Log:
  start using the new Field API in the test cases
  
  Revision  Changes    Path
  1.7       +7 -7      jakarta-lucene/src/test/org/apache/lucene/document/TestDocument.java
  
  Index: TestDocument.java
  ===================================================================
  RCS file: /home/cvs/jakarta-lucene/src/test/org/apache/lucene/document/TestDocument.java,v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -u -r1.6 -r1.7
  --- TestDocument.java	30 Aug 2004 21:03:40 -0000	1.6
  +++ TestDocument.java	5 Sep 2004 22:27:42 -0000	1.7
  @@ -140,14 +140,14 @@
       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;
       }
   
  
  
  
  1.6       +5 -5      jakarta-lucene/src/test/org/apache/lucene/search/TestDateFilter.java
  
  Index: TestDateFilter.java
  ===================================================================
  RCS file: /home/cvs/jakarta-lucene/src/test/org/apache/lucene/search/TestDateFilter.java,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- TestDateFilter.java	29 Mar 2004 22:48:06 -0000	1.5
  +++ TestDateFilter.java	5 Sep 2004 22:27:42 -0000	1.6
  @@ -59,8 +59,8 @@
   
    	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 @@
   
    	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();
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: lucene-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: lucene-dev-help@jakarta.apache.org


Mime
View raw message