mirror of https://github.com/apache/lucene.git
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:
parent
529214394c
commit
c3f90ad76e
|
@ -53,7 +53,7 @@ public class TestBasics extends TestCase {
|
||||||
//writer.infoStream = System.out;
|
//writer.infoStream = System.out;
|
||||||
for (int i = 0; i < 1000; i++) {
|
for (int i = 0; i < 1000; i++) {
|
||||||
Document doc = new Document();
|
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);
|
writer.addDocument(doc);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -96,8 +96,8 @@ public class TestBasics extends TestCase {
|
||||||
|
|
||||||
public void testBoolean() throws Exception {
|
public void testBoolean() throws Exception {
|
||||||
BooleanQuery query = new BooleanQuery();
|
BooleanQuery query = new BooleanQuery();
|
||||||
query.add(new TermQuery(new Term("field", "seventy")), true, false);
|
query.add(new TermQuery(new Term("field", "seventy")), BooleanClause.Occur.MUST);
|
||||||
query.add(new TermQuery(new Term("field", "seven")), true, false);
|
query.add(new TermQuery(new Term("field", "seven")), BooleanClause.Occur.MUST);
|
||||||
checkHits(query, new int[]
|
checkHits(query, new int[]
|
||||||
{77, 777, 177, 277, 377, 477, 577, 677, 770, 771, 772, 773, 774, 775,
|
{77, 777, 177, 277, 377, 477, 577, 677, 770, 771, 772, 773, 774, 775,
|
||||||
776, 778, 779, 877, 977});
|
776, 778, 779, 877, 977});
|
||||||
|
@ -105,8 +105,8 @@ public class TestBasics extends TestCase {
|
||||||
|
|
||||||
public void testBoolean2() throws Exception {
|
public void testBoolean2() throws Exception {
|
||||||
BooleanQuery query = new BooleanQuery();
|
BooleanQuery query = new BooleanQuery();
|
||||||
query.add(new TermQuery(new Term("field", "sevento")), true, false);
|
query.add(new TermQuery(new Term("field", "sevento")), BooleanClause.Occur.MUST);
|
||||||
query.add(new TermQuery(new Term("field", "sevenly")), true, false);
|
query.add(new TermQuery(new Term("field", "sevenly")), BooleanClause.Occur.MUST);
|
||||||
checkHits(query, new int[] {});
|
checkHits(query, new int[] {});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -39,7 +39,7 @@ public class TestSpans extends TestCase {
|
||||||
IndexWriter writer= new IndexWriter(directory, new WhitespaceAnalyzer(), true);
|
IndexWriter writer= new IndexWriter(directory, new WhitespaceAnalyzer(), true);
|
||||||
for (int i = 0; i < docFields.length; i++) {
|
for (int i = 0; i < docFields.length; i++) {
|
||||||
Document doc = new Document();
|
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.addDocument(doc);
|
||||||
}
|
}
|
||||||
writer.close();
|
writer.close();
|
||||||
|
|
Loading…
Reference in New Issue