lucene-java-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dna...@apache.org
Subject svn commit: r168642 - /lucene/java/trunk/src/test/org/apache/lucene/search/spans/TestBasics.java /lucene/java/trunk/src/test/org/apache/lucene/search/spans/TestSpans.java
Date Fri, 06 May 2005 19:32:55 GMT
Author: dnaber
Date: Fri May  6 12:32:54 2005
New Revision: 168642

URL: http://svn.apache.org/viewcvs?rev=168642&view=rev
Log:
use non-deprecated API

Modified:
    lucene/java/trunk/src/test/org/apache/lucene/search/spans/TestBasics.java
    lucene/java/trunk/src/test/org/apache/lucene/search/spans/TestSpans.java

Modified: lucene/java/trunk/src/test/org/apache/lucene/search/spans/TestBasics.java
URL: http://svn.apache.org/viewcvs/lucene/java/trunk/src/test/org/apache/lucene/search/spans/TestBasics.java?rev=168642&r1=168641&r2=168642&view=diff
==============================================================================
--- lucene/java/trunk/src/test/org/apache/lucene/search/spans/TestBasics.java (original)
+++ lucene/java/trunk/src/test/org/apache/lucene/search/spans/TestBasics.java Fri May  6 12:32:54
2005
@@ -53,7 +53,7 @@
     //writer.infoStream = System.out;
     for (int i = 0; i < 1000; i++) {
       Document doc = new Document();
-      doc.add(Field.Text("field", English.intToEnglish(i)));
+      doc.add(new Field("field", English.intToEnglish(i), Field.Store.YES, Field.Index.TOKENIZED));
       writer.addDocument(doc);
     }
 
@@ -96,8 +96,8 @@
 
   public void testBoolean() throws Exception {
     BooleanQuery query = new BooleanQuery();
-    query.add(new TermQuery(new Term("field", "seventy")), true, false);
-    query.add(new TermQuery(new Term("field", "seven")), true, false);
+    query.add(new TermQuery(new Term("field", "seventy")), BooleanClause.Occur.MUST);
+    query.add(new TermQuery(new Term("field", "seven")), BooleanClause.Occur.MUST);
     checkHits(query, new int[]
       {77, 777, 177, 277, 377, 477, 577, 677, 770, 771, 772, 773, 774, 775,
        776, 778, 779, 877, 977});
@@ -105,8 +105,8 @@
 
   public void testBoolean2() throws Exception {
     BooleanQuery query = new BooleanQuery();
-    query.add(new TermQuery(new Term("field", "sevento")), true, false);
-    query.add(new TermQuery(new Term("field", "sevenly")), true, false);
+    query.add(new TermQuery(new Term("field", "sevento")), BooleanClause.Occur.MUST);
+    query.add(new TermQuery(new Term("field", "sevenly")), BooleanClause.Occur.MUST);
     checkHits(query, new int[] {});
   }
 

Modified: lucene/java/trunk/src/test/org/apache/lucene/search/spans/TestSpans.java
URL: http://svn.apache.org/viewcvs/lucene/java/trunk/src/test/org/apache/lucene/search/spans/TestSpans.java?rev=168642&r1=168641&r2=168642&view=diff
==============================================================================
--- lucene/java/trunk/src/test/org/apache/lucene/search/spans/TestSpans.java (original)
+++ lucene/java/trunk/src/test/org/apache/lucene/search/spans/TestSpans.java Fri May  6 12:32:54
2005
@@ -39,7 +39,7 @@
     IndexWriter writer= new IndexWriter(directory, new WhitespaceAnalyzer(), true);
     for (int i = 0; i < docFields.length; i++) {
       Document doc = new Document();
-      doc.add(Field.Text(field, docFields[i]));
+      doc.add(new Field(field, docFields[i], Field.Store.YES, Field.Index.TOKENIZED));
       writer.addDocument(doc);
     }
     writer.close();



Mime
View raw message