mirror of https://github.com/apache/lucene.git
use the non-deprecated API, no functional change
git-svn-id: https://svn.apache.org/repos/asf/lucene/java/trunk@150586 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
8bf11bc856
commit
d644998f55
|
@ -25,7 +25,7 @@ public class TestFieldInfos extends TestCase {
|
|||
protected void tearDown() {
|
||||
}
|
||||
|
||||
public void test() throws IOException {
|
||||
public void test() {
|
||||
//Positive test of FieldInfos
|
||||
assertTrue(testDoc != null);
|
||||
FieldInfos fieldInfos = new FieldInfos();
|
||||
|
|
|
@ -95,15 +95,15 @@ public class TestFilterIndexReader extends TestCase {
|
|||
new IndexWriter(directory, new WhitespaceAnalyzer(), true);
|
||||
|
||||
Document d1 = new Document();
|
||||
d1.add(Field.Text("default","one two"));
|
||||
d1.add(new Field("default","one two", Field.Store.YES, Field.Index.TOKENIZED));
|
||||
writer.addDocument(d1);
|
||||
|
||||
Document d2 = new Document();
|
||||
d2.add(Field.Text("default","one three"));
|
||||
d2.add(new Field("default","one three", Field.Store.YES, Field.Index.TOKENIZED));
|
||||
writer.addDocument(d2);
|
||||
|
||||
Document d3 = new Document();
|
||||
d3.add(Field.Text("default","two four"));
|
||||
d3.add(new Field("default","two four", Field.Store.YES, Field.Index.TOKENIZED));
|
||||
writer.addDocument(d3);
|
||||
|
||||
writer.close();
|
||||
|
|
|
@ -414,27 +414,27 @@ public class TestIndexReader extends TestCase
|
|||
private void addDocumentWithFields(IndexWriter writer) throws IOException
|
||||
{
|
||||
Document doc = new Document();
|
||||
doc.add(Field.Keyword("keyword","test1"));
|
||||
doc.add(Field.Text("text","test1"));
|
||||
doc.add(Field.UnIndexed("unindexed","test1"));
|
||||
doc.add(Field.UnStored("unstored","test1"));
|
||||
doc.add(new Field("keyword","test1", Field.Store.YES, Field.Index.UN_TOKENIZED));
|
||||
doc.add(new Field("text","test1", Field.Store.YES, Field.Index.TOKENIZED));
|
||||
doc.add(new Field("unindexed","test1", Field.Store.YES, Field.Index.NO));
|
||||
doc.add(new Field("unstored","test1", Field.Store.NO, Field.Index.TOKENIZED));
|
||||
writer.addDocument(doc);
|
||||
}
|
||||
|
||||
private void addDocumentWithDifferentFields(IndexWriter writer) throws IOException
|
||||
{
|
||||
Document doc = new Document();
|
||||
doc.add(Field.Keyword("keyword2","test1"));
|
||||
doc.add(Field.Text("text2","test1"));
|
||||
doc.add(Field.UnIndexed("unindexed2","test1"));
|
||||
doc.add(Field.UnStored("unstored2","test1"));
|
||||
doc.add(new Field("keyword2","test1", Field.Store.YES, Field.Index.UN_TOKENIZED));
|
||||
doc.add(new Field("text2","test1", Field.Store.YES, Field.Index.TOKENIZED));
|
||||
doc.add(new Field("unindexed2","test1", Field.Store.YES, Field.Index.NO));
|
||||
doc.add(new Field("unstored2","test1", Field.Store.NO, Field.Index.TOKENIZED));
|
||||
writer.addDocument(doc);
|
||||
}
|
||||
|
||||
private void addDoc(IndexWriter writer, String value)
|
||||
{
|
||||
Document doc = new Document();
|
||||
doc.add(Field.UnStored("content", value));
|
||||
doc.add(new Field("content", value, Field.Store.NO, Field.Index.TOKENIZED));
|
||||
|
||||
try
|
||||
{
|
||||
|
|
|
@ -74,7 +74,7 @@ public class TestIndexWriter extends TestCase
|
|||
private void addDoc(IndexWriter writer)
|
||||
{
|
||||
Document doc = new Document();
|
||||
doc.add(Field.UnStored("content", "aaa"));
|
||||
doc.add(new Field("content", "aaa", Field.Store.NO, Field.Index.TOKENIZED));
|
||||
|
||||
try {
|
||||
writer.addDocument(doc);
|
||||
|
|
|
@ -226,7 +226,7 @@ public class TestSegmentTermDocs extends TestCase {
|
|||
private void addDoc(IndexWriter writer, String value) throws IOException
|
||||
{
|
||||
Document doc = new Document();
|
||||
doc.add(Field.UnStored("content", value));
|
||||
doc.add(new Field("content", value, Field.Store.NO, Field.Index.TOKENIZED));
|
||||
writer.addDocument(doc);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -98,7 +98,7 @@ public class TestSegmentTermEnum extends TestCase
|
|||
private void addDoc(IndexWriter writer, String value)
|
||||
{
|
||||
Document doc = new Document();
|
||||
doc.add(Field.UnStored("content", value));
|
||||
doc.add(new Field("content", value, Field.Store.NO, Field.Index.TOKENIZED));
|
||||
|
||||
try {
|
||||
writer.addDocument(doc);
|
||||
|
|
Loading…
Reference in New Issue