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 TestFilteredQuery.java TestDocBoost.java TestFuzzyQuery.java TestMultiSearcher.java TestBooleanPrefixQuery.java
Date Mon, 06 Sep 2004 22:01:49 GMT
dnaber      2004/09/06 15:01:49

  Modified:    src/test/org/apache/lucene/search TestFilteredQuery.java
                        TestDocBoost.java TestFuzzyQuery.java
                        TestMultiSearcher.java TestBooleanPrefixQuery.java
  Log:
  don't call the deprecated Field API
  
  Revision  Changes    Path
  1.6       +9 -9      jakarta-lucene/src/test/org/apache/lucene/search/TestFilteredQuery.java
  
  Index: TestFilteredQuery.java
  ===================================================================
  RCS file: /home/cvs/jakarta-lucene/src/test/org/apache/lucene/search/TestFilteredQuery.java,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- TestFilteredQuery.java	10 Jul 2004 06:19:01 -0000	1.5
  +++ TestFilteredQuery.java	6 Sep 2004 22:01:49 -0000	1.6
  @@ -51,23 +51,23 @@
       IndexWriter writer = new IndexWriter (directory, new WhitespaceAnalyzer(), true);
   
       Document doc = new Document();
  -    doc.add (Field.Text ("field", "one two three four five"));
  -    doc.add (Field.Text ("sorter", "b"));
  +    doc.add (new Field("field", "one two three four five", Field.Store.YES, Field.Index.TOKENIZED));
  +    doc.add (new Field("sorter", "b", Field.Store.YES, Field.Index.TOKENIZED));
       writer.addDocument (doc);
   
       doc = new Document();
  -    doc.add (Field.Text ("field", "one two three four"));
  -    doc.add (Field.Text ("sorter", "d"));
  +    doc.add (new Field("field", "one two three four", Field.Store.YES, Field.Index.TOKENIZED));
  +    doc.add (new Field("sorter", "d", Field.Store.YES, Field.Index.TOKENIZED));
       writer.addDocument (doc);
   
       doc = new Document();
  -    doc.add (Field.Text ("field", "one two three y"));
  -    doc.add (Field.Text ("sorter", "a"));
  +    doc.add (new Field("field", "one two three y", Field.Store.YES, Field.Index.TOKENIZED));
  +    doc.add (new Field("sorter", "a", Field.Store.YES, Field.Index.TOKENIZED));
       writer.addDocument (doc);
   
       doc = new Document();
  -    doc.add (Field.Text ("field", "one two x"));
  -    doc.add (Field.Text ("sorter", "c"));
  +    doc.add (new Field("field", "one two x", Field.Store.YES, Field.Index.TOKENIZED));
  +    doc.add (new Field("sorter", "c", Field.Store.YES, Field.Index.TOKENIZED));
       writer.addDocument (doc);
   
       writer.optimize ();
  
  
  
  1.5       +3 -3      jakarta-lucene/src/test/org/apache/lucene/search/TestDocBoost.java
  
  Index: TestDocBoost.java
  ===================================================================
  RCS file: /home/cvs/jakarta-lucene/src/test/org/apache/lucene/search/TestDocBoost.java,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- TestDocBoost.java	29 Mar 2004 22:48:06 -0000	1.4
  +++ TestDocBoost.java	6 Sep 2004 22:01:49 -0000	1.5
  @@ -40,8 +40,8 @@
       RAMDirectory store = new RAMDirectory();
       IndexWriter writer = new IndexWriter(store, new SimpleAnalyzer(), true);
       
  -    Field f1 = Field.Text("field", "word");
  -    Field f2 = Field.Text("field", "word");
  +    Field f1 = new Field("field", "word", Field.Store.YES, Field.Index.TOKENIZED);
  +    Field f2 = new Field("field", "word", Field.Store.YES, Field.Index.TOKENIZED);
       f2.setBoost(2.0f);
       
       Document d1 = new Document();
  
  
  
  1.3       +1 -1      jakarta-lucene/src/test/org/apache/lucene/search/TestFuzzyQuery.java
  
  Index: TestFuzzyQuery.java
  ===================================================================
  RCS file: /home/cvs/jakarta-lucene/src/test/org/apache/lucene/search/TestFuzzyQuery.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- TestFuzzyQuery.java	13 Aug 2004 18:35:02 -0000	1.2
  +++ TestFuzzyQuery.java	6 Sep 2004 22:01:49 -0000	1.3
  @@ -148,7 +148,7 @@
     
     private void addDoc(String text, IndexWriter writer) throws IOException {
       Document doc = new Document();
  -    doc.add(Field.Text("field", text));
  +    doc.add(new Field("field", text, Field.Store.YES, Field.Index.TOKENIZED));
       writer.addDocument(doc);
     }
   
  
  
  
  1.7       +12 -10    jakarta-lucene/src/test/org/apache/lucene/search/TestMultiSearcher.java
  
  Index: TestMultiSearcher.java
  ===================================================================
  RCS file: /home/cvs/jakarta-lucene/src/test/org/apache/lucene/search/TestMultiSearcher.java,v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -u -r1.6 -r1.7
  --- TestMultiSearcher.java	2 Mar 2004 13:09:57 -0000	1.6
  +++ TestMultiSearcher.java	6 Sep 2004 22:01:49 -0000	1.7
  @@ -60,21 +60,23 @@
   
           // creating a document to store
           Document lDoc = new Document();
  -        lDoc.add(Field.Text("fulltext", "Once upon a time....."));
  -        lDoc.add(Field.Keyword("id", "doc1"));
  -        lDoc.add(Field.Keyword("handle", "1"));
  +        lDoc.add(new Field("fulltext", "Once upon a time.....", Field.Store.YES, Field.Index.TOKENIZED));
  +        lDoc.add(new Field("id", "doc1", Field.Store.YES, Field.Index.UN_TOKENIZED));
  +        lDoc.add(new Field("handle", "1", Field.Store.YES, Field.Index.UN_TOKENIZED));
   
           // creating a document to store
           Document lDoc2 = new Document();
  -        lDoc2.add(Field.Text("fulltext", "in a galaxy far far away....."));
  -        lDoc2.add(Field.Keyword("id", "doc2"));
  -        lDoc2.add(Field.Keyword("handle", "1"));
  +        lDoc2.add(new Field("fulltext", "in a galaxy far far away.....",
  +            Field.Store.YES, Field.Index.TOKENIZED));
  +        lDoc2.add(new Field("id", "doc2", Field.Store.YES, Field.Index.UN_TOKENIZED));
  +        lDoc2.add(new Field("handle", "1", Field.Store.YES, Field.Index.UN_TOKENIZED));
   
           // creating a document to store
           Document lDoc3 = new Document();
  -        lDoc3.add(Field.Text("fulltext", "a bizarre bug manifested itself...."));
  -        lDoc3.add(Field.Keyword("id", "doc3"));
  -        lDoc3.add(Field.Keyword("handle", "1"));
  +        lDoc3.add(new Field("fulltext", "a bizarre bug manifested itself....",
  +            Field.Store.YES, Field.Index.TOKENIZED));
  +        lDoc3.add(new Field("id", "doc3", Field.Store.YES, Field.Index.UN_TOKENIZED));
  +        lDoc3.add(new Field("handle", "1", Field.Store.YES, Field.Index.UN_TOKENIZED));
   
           // creating an index writer for the first index
           IndexWriter writerA = new IndexWriter(indexStoreA, new StandardAnalyzer(), true);
  
  
  
  1.4       +2 -2      jakarta-lucene/src/test/org/apache/lucene/search/TestBooleanPrefixQuery.java
  
  Index: TestBooleanPrefixQuery.java
  ===================================================================
  RCS file: /home/cvs/jakarta-lucene/src/test/org/apache/lucene/search/TestBooleanPrefixQuery.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- TestBooleanPrefixQuery.java	30 Aug 2004 20:49:34 -0000	1.3
  +++ TestBooleanPrefixQuery.java	6 Sep 2004 22:01:49 -0000	1.4
  @@ -67,7 +67,7 @@
                                              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