mirror of https://github.com/apache/lucene.git
don't call the deprecated Field API
git-svn-id: https://svn.apache.org/repos/asf/lucene/java/trunk@150494 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
1d70de80d9
commit
9b0315169b
|
@ -43,7 +43,7 @@ class SearchTest {
|
|||
};
|
||||
for (int j = 0; j < docs.length; j++) {
|
||||
Document d = new Document();
|
||||
d.add(Field.Text("contents", docs[j]));
|
||||
d.add(new Field("contents", docs[j], Field.Store.YES, Field.Index.TOKENIZED));
|
||||
writer.addDocument(d);
|
||||
}
|
||||
writer.close();
|
||||
|
|
|
@ -43,8 +43,8 @@ class SearchTestForDuplicates {
|
|||
|
||||
for (int j = 0; j < MAX_DOCS; j++) {
|
||||
Document d = new Document();
|
||||
d.add(Field.Text(PRIORITY_FIELD, HIGH_PRIORITY));
|
||||
d.add(Field.Text(ID_FIELD, Integer.toString(j)));
|
||||
d.add(new Field(PRIORITY_FIELD, HIGH_PRIORITY, Field.Store.YES, Field.Index.TOKENIZED));
|
||||
d.add(new Field(ID_FIELD, Integer.toString(j), Field.Store.YES, Field.Index.TOKENIZED));
|
||||
writer.addDocument(d);
|
||||
}
|
||||
writer.close();
|
||||
|
|
|
@ -91,7 +91,7 @@ public class TestSearch extends TestCase {
|
|||
};
|
||||
for (int j = 0; j < docs.length; j++) {
|
||||
Document d = new Document();
|
||||
d.add(Field.Text("contents", docs[j]));
|
||||
d.add(new Field("contents", docs[j], Field.Store.YES, Field.Index.TOKENIZED));
|
||||
writer.addDocument(d);
|
||||
}
|
||||
writer.close();
|
||||
|
|
|
@ -91,8 +91,8 @@ public class TestSearchForDuplicates extends TestCase {
|
|||
|
||||
for (int j = 0; j < MAX_DOCS; j++) {
|
||||
Document d = new Document();
|
||||
d.add(Field.Text(PRIORITY_FIELD, HIGH_PRIORITY));
|
||||
d.add(Field.Text(ID_FIELD, Integer.toString(j)));
|
||||
d.add(new Field(PRIORITY_FIELD, HIGH_PRIORITY, Field.Store.YES, Field.Index.TOKENIZED));
|
||||
d.add(new Field(ID_FIELD, Integer.toString(j), Field.Store.YES, Field.Index.TOKENIZED));
|
||||
writer.addDocument(d);
|
||||
}
|
||||
writer.close();
|
||||
|
|
|
@ -55,8 +55,8 @@ class ThreadSafetyTest {
|
|||
for (int i = 0; i < 1024*ITERATIONS; i++) {
|
||||
Document d = new Document();
|
||||
int n = RANDOM.nextInt();
|
||||
d.add(Field.Keyword("id", Integer.toString(n)));
|
||||
d.add(Field.UnStored("contents", English.intToEnglish(n)));
|
||||
d.add(new Field("id", Integer.toString(n), Field.Store.YES, Field.Index.UN_TOKENIZED));
|
||||
d.add(new Field("contents", English.intToEnglish(n), Field.Store.NO, Field.Index.TOKENIZED));
|
||||
System.out.println("Adding " + n);
|
||||
|
||||
// Switch between single and multiple file segments
|
||||
|
|
Loading…
Reference in New Issue