use non-deprecated API

git-svn-id: https://svn.apache.org/repos/asf/lucene/java/trunk@168642 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Daniel Naber 2005-05-06 19:32:54 +00:00
parent 529214394c
commit c3f90ad76e
2 changed files with 6 additions and 6 deletions

View File

@ -53,7 +53,7 @@ public class TestBasics extends TestCase {
//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 class TestBasics extends TestCase {
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 class TestBasics extends TestCase {
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[] {});
}

View File

@ -39,7 +39,7 @@ public class TestSpans extends TestCase {
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();