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 TestRangeQuery.java TestPhrasePrefixQuery.java TestSimilarity.java TestSetNorm.java TestPositionIncrement.java TestPhraseQuery.java TestRemoteSearchable.java TestNot.java TestWildcard.java TestTermVectors.java TestPrefixQuery.java
Date Tue, 07 Sep 2004 18:26:37 GMT
dnaber      2004/09/07 11:26:37

  Modified:    src/test/org/apache/lucene/search TestRangeQuery.java
                        TestPhrasePrefixQuery.java TestSimilarity.java
                        TestSetNorm.java TestPositionIncrement.java
                        TestPhraseQuery.java TestRemoteSearchable.java
                        TestNot.java TestWildcard.java TestTermVectors.java
                        TestPrefixQuery.java
  Log:
  remove the last calls of the deprecated Field API
  
  Revision  Changes    Path
  1.4       +2 -2      jakarta-lucene/src/test/org/apache/lucene/search/TestRangeQuery.java
  
  Index: TestRangeQuery.java
  ===================================================================
  RCS file: /home/cvs/jakarta-lucene/src/test/org/apache/lucene/search/TestRangeQuery.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- TestRangeQuery.java	20 Sep 2003 21:12:41 -0000	1.3
  +++ TestRangeQuery.java	7 Sep 2004 18:26:36 -0000	1.4
  @@ -86,8 +86,8 @@
     private void insertDoc(IndexWriter writer, String content) throws IOException {
       Document doc = new Document();
   
  -    doc.add(Field.Keyword("id", "id" + docCount));
  -    doc.add(Field.UnStored("content", content));
  +    doc.add(new Field("id", "id" + docCount, Field.Store.YES, Field.Index.UN_TOKENIZED));
  +    doc.add(new Field("content", content, Field.Store.NO, Field.Index.TOKENIZED));
   
       writer.addDocument(doc);
       docCount++;
  
  
  
  1.4       +6 -6      jakarta-lucene/src/test/org/apache/lucene/search/TestPhrasePrefixQuery.java
  
  Index: TestPhrasePrefixQuery.java
  ===================================================================
  RCS file: /home/cvs/jakarta-lucene/src/test/org/apache/lucene/search/TestPhrasePrefixQuery.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- TestPhrasePrefixQuery.java	29 Mar 2004 22:48:06 -0000	1.3
  +++ TestPhrasePrefixQuery.java	7 Sep 2004 18:26:36 -0000	1.4
  @@ -58,11 +58,11 @@
           Document doc3 = new Document();
           Document doc4 = new Document();
           Document doc5 = new Document();
  -        doc1.add(Field.Text("body", "blueberry pie"));
  -        doc2.add(Field.Text("body", "blueberry strudel"));
  -        doc3.add(Field.Text("body", "blueberry pizza"));
  -        doc4.add(Field.Text("body", "blueberry chewing gum"));
  -        doc5.add(Field.Text("body", "piccadilly circus"));
  +        doc1.add(new Field("body", "blueberry pie", Field.Store.YES, Field.Index.TOKENIZED));
  +        doc2.add(new Field("body", "blueberry strudel", Field.Store.YES, Field.Index.TOKENIZED));
  +        doc3.add(new Field("body", "blueberry pizza", Field.Store.YES, Field.Index.TOKENIZED));
  +        doc4.add(new Field("body", "blueberry chewing gum", Field.Store.YES, Field.Index.TOKENIZED));
  +        doc5.add(new Field("body", "piccadilly circus", Field.Store.YES, Field.Index.TOKENIZED));
           writer.addDocument(doc1);
           writer.addDocument(doc2);
           writer.addDocument(doc3);
  
  
  
  1.7       +3 -3      jakarta-lucene/src/test/org/apache/lucene/search/TestSimilarity.java
  
  Index: TestSimilarity.java
  ===================================================================
  RCS file: /home/cvs/jakarta-lucene/src/test/org/apache/lucene/search/TestSimilarity.java,v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -u -r1.6 -r1.7
  --- TestSimilarity.java	27 Aug 2004 21:59:31 -0000	1.6
  +++ TestSimilarity.java	7 Sep 2004 18:26:36 -0000	1.7
  @@ -54,10 +54,10 @@
       writer.setSimilarity(new SimpleSimilarity());
       
       Document d1 = new Document();
  -    d1.add(Field.Text("field", "a c"));
  +    d1.add(new Field("field", "a c", Field.Store.YES, Field.Index.TOKENIZED));
   
       Document d2 = new Document();
  -    d2.add(Field.Text("field", "a b c"));
  +    d2.add(new Field("field", "a b c", Field.Store.YES, Field.Index.TOKENIZED));
       
       writer.addDocument(d1);
       writer.addDocument(d2);
  
  
  
  1.3       +2 -2      jakarta-lucene/src/test/org/apache/lucene/search/TestSetNorm.java
  
  Index: TestSetNorm.java
  ===================================================================
  RCS file: /home/cvs/jakarta-lucene/src/test/org/apache/lucene/search/TestSetNorm.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- TestSetNorm.java	29 Mar 2004 22:48:06 -0000	1.2
  +++ TestSetNorm.java	7 Sep 2004 18:26:36 -0000	1.3
  @@ -42,7 +42,7 @@
       IndexWriter writer = new IndexWriter(store, new SimpleAnalyzer(), true);
       
       // add the same document four times
  -    Field f1 = Field.Text("field", "word");
  +    Field f1 = new Field("field", "word", Field.Store.YES, Field.Index.TOKENIZED);
       Document d1 = new Document();
       d1.add(f1);
       writer.addDocument(d1);
  
  
  
  1.5       +2 -2      jakarta-lucene/src/test/org/apache/lucene/search/TestPositionIncrement.java
  
  Index: TestPositionIncrement.java
  ===================================================================
  RCS file: /home/cvs/jakarta-lucene/src/test/org/apache/lucene/search/TestPositionIncrement.java,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- TestPositionIncrement.java	29 Mar 2004 22:48:06 -0000	1.4
  +++ TestPositionIncrement.java	7 Sep 2004 18:26:36 -0000	1.5
  @@ -65,7 +65,7 @@
       RAMDirectory store = new RAMDirectory();
       IndexWriter writer = new IndexWriter(store, analyzer, true);
       Document d = new Document();
  -    d.add(Field.Text("field", "bogus"));
  +    d.add(new Field("field", "bogus", Field.Store.YES, Field.Index.TOKENIZED));
       writer.addDocument(d);
       writer.optimize();
       writer.close();
  
  
  
  1.9       +2 -2      jakarta-lucene/src/test/org/apache/lucene/search/TestPhraseQuery.java
  
  Index: TestPhraseQuery.java
  ===================================================================
  RCS file: /home/cvs/jakarta-lucene/src/test/org/apache/lucene/search/TestPhraseQuery.java,v
  retrieving revision 1.8
  retrieving revision 1.9
  diff -u -r1.8 -r1.9
  --- TestPhraseQuery.java	30 Aug 2004 20:52:15 -0000	1.8
  +++ TestPhraseQuery.java	7 Sep 2004 18:26:36 -0000	1.9
  @@ -41,7 +41,7 @@
       IndexWriter writer = new IndexWriter(directory, new WhitespaceAnalyzer(), true);
       
       Document doc = new Document();
  -    doc.add(Field.Text("field", "one two three four five"));
  +    doc.add(new Field("field", "one two three four five", Field.Store.YES, Field.Index.TOKENIZED));
       writer.addDocument(doc);
       
       writer.optimize();
  @@ -155,7 +155,7 @@
       StopAnalyzer stopAnalyzer = new StopAnalyzer();
       IndexWriter writer = new IndexWriter(directory, stopAnalyzer, true);
       Document doc = new Document();
  -    doc.add(Field.Text("field", "the stop words are here"));
  +    doc.add(new Field("field", "the stop words are here", Field.Store.YES, Field.Index.TOKENIZED));
       writer.addDocument(doc);
       writer.close();
   
  
  
  
  1.9       +2 -2      jakarta-lucene/src/test/org/apache/lucene/search/TestRemoteSearchable.java
  
  Index: TestRemoteSearchable.java
  ===================================================================
  RCS file: /home/cvs/jakarta-lucene/src/test/org/apache/lucene/search/TestRemoteSearchable.java,v
  retrieving revision 1.8
  retrieving revision 1.9
  diff -u -r1.8 -r1.9
  --- TestRemoteSearchable.java	27 Aug 2004 21:59:31 -0000	1.8
  +++ TestRemoteSearchable.java	7 Sep 2004 18:26:36 -0000	1.9
  @@ -54,7 +54,7 @@
       RAMDirectory indexStore = new RAMDirectory();
       IndexWriter writer = new IndexWriter(indexStore,new SimpleAnalyzer(),true);
       Document doc = new Document();
  -    doc.add(Field.Text("test", "test text"));
  +    doc.add(new Field("test", "test text", Field.Store.YES, Field.Index.TOKENIZED));
       writer.addDocument(doc);
       writer.optimize();
       writer.close();
  
  
  
  1.5       +2 -2      jakarta-lucene/src/test/org/apache/lucene/search/TestNot.java
  
  Index: TestNot.java
  ===================================================================
  RCS file: /home/cvs/jakarta-lucene/src/test/org/apache/lucene/search/TestNot.java,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- TestNot.java	8 Aug 2004 19:36:59 -0000	1.4
  +++ TestNot.java	7 Sep 2004 18:26:36 -0000	1.5
  @@ -40,7 +40,7 @@
       IndexWriter writer = new IndexWriter(store, new SimpleAnalyzer(), true);
   
       Document d1 = new Document();
  -    d1.add(Field.Text("field", "a b"));
  +    d1.add(new Field("field", "a b", Field.Store.YES, Field.Index.TOKENIZED));
   
       writer.addDocument(d1);
       writer.optimize();
  
  
  
  1.9       +1 -1      jakarta-lucene/src/test/org/apache/lucene/search/TestWildcard.java
  
  Index: TestWildcard.java
  ===================================================================
  RCS file: /home/cvs/jakarta-lucene/src/test/org/apache/lucene/search/TestWildcard.java,v
  retrieving revision 1.8
  retrieving revision 1.9
  diff -u -r1.8 -r1.9
  --- TestWildcard.java	27 Aug 2004 21:59:31 -0000	1.8
  +++ TestWildcard.java	7 Sep 2004 18:26:36 -0000	1.9
  @@ -115,7 +115,7 @@
           IndexWriter writer = new IndexWriter(indexStore, new SimpleAnalyzer(), true);
   	for (int i = 0; i < contents.length; ++i) {
   	    Document doc = new Document();
  -	    doc.add(Field.Text(field, contents[i]));
  +	    doc.add(new Field(field, contents[i], Field.Store.YES, Field.Index.TOKENIZED));
   	    writer.addDocument(doc);
   	}
   	writer.optimize();
  
  
  
  1.4       +4 -2      jakarta-lucene/src/test/org/apache/lucene/search/TestTermVectors.java
  
  Index: TestTermVectors.java
  ===================================================================
  RCS file: /home/cvs/jakarta-lucene/src/test/org/apache/lucene/search/TestTermVectors.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- TestTermVectors.java	13 Aug 2004 18:38:44 -0000	1.3
  +++ TestTermVectors.java	7 Sep 2004 18:26:36 -0000	1.4
  @@ -43,7 +43,8 @@
       //writer.infoStream = System.out;
       for (int i = 0; i < 1000; i++) {
         Document doc = new Document();
  -      doc.add(Field.Text("field", English.intToEnglish(i), true));
  +      doc.add(new Field("field", English.intToEnglish(i),
  +          Field.Store.YES, Field.Index.TOKENIZED, Field.TermVector.YES));
         writer.addDocument(doc);
       }
       writer.close();
  @@ -212,7 +213,8 @@
     
     private void setupDoc(Document doc, String text)
     {
  -    doc.add(Field.Text("field", text, true));
  +    doc.add(new Field("field", text, Field.Store.YES,
  +        Field.Index.TOKENIZED, Field.TermVector.YES));
       //System.out.println("Document: " + doc);
     }
     
  
  
  
  1.4       +1 -1      jakarta-lucene/src/test/org/apache/lucene/search/TestPrefixQuery.java
  
  Index: TestPrefixQuery.java
  ===================================================================
  RCS file: /home/cvs/jakarta-lucene/src/test/org/apache/lucene/search/TestPrefixQuery.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- TestPrefixQuery.java	29 Mar 2004 22:48:06 -0000	1.3
  +++ TestPrefixQuery.java	7 Sep 2004 18:26:36 -0000	1.4
  @@ -39,7 +39,7 @@
       IndexWriter writer = new IndexWriter(directory, new WhitespaceAnalyzer(), true);
       for (int i = 0; i < categories.length; i++) {
         Document doc = new Document();
  -      doc.add(Field.Keyword("category", categories[i]));
  +      doc.add(new Field("category", categories[i], Field.Store.YES, Field.Index.UN_TOKENIZED));
         writer.addDocument(doc);
       }
       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