mirror of
https://github.com/apache/lucene.git
synced 2025-02-08 11:05:29 +00:00
add dv to tests
git-svn-id: https://svn.apache.org/repos/asf/lucene/dev/branches/lucene4547@1436453 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
74471833e6
commit
f7615e6b35
@ -32,6 +32,7 @@ import org.apache.lucene.analysis.*;
|
|||||||
import org.apache.lucene.document.Document;
|
import org.apache.lucene.document.Document;
|
||||||
import org.apache.lucene.document.Field;
|
import org.apache.lucene.document.Field;
|
||||||
import org.apache.lucene.document.FieldType;
|
import org.apache.lucene.document.FieldType;
|
||||||
|
import org.apache.lucene.document.LongDocValuesField;
|
||||||
import org.apache.lucene.document.StringField;
|
import org.apache.lucene.document.StringField;
|
||||||
import org.apache.lucene.search.IndexSearcher;
|
import org.apache.lucene.search.IndexSearcher;
|
||||||
import org.apache.lucene.search.ScoreDoc;
|
import org.apache.lucene.search.ScoreDoc;
|
||||||
@ -43,7 +44,6 @@ import org.apache.lucene.util.Bits;
|
|||||||
import org.apache.lucene.util.LuceneTestCase;
|
import org.apache.lucene.util.LuceneTestCase;
|
||||||
import org.apache.lucene.util._TestUtil;
|
import org.apache.lucene.util._TestUtil;
|
||||||
|
|
||||||
//nocommit: make sure disk full etc tests here test DV2.0
|
|
||||||
public class TestIndexWriterDelete extends LuceneTestCase {
|
public class TestIndexWriterDelete extends LuceneTestCase {
|
||||||
|
|
||||||
// test the simple case
|
// test the simple case
|
||||||
@ -390,6 +390,7 @@ public class TestIndexWriterDelete extends LuceneTestCase {
|
|||||||
doc.add(newTextField("content", "aaa", Field.Store.NO));
|
doc.add(newTextField("content", "aaa", Field.Store.NO));
|
||||||
doc.add(newStringField("id", String.valueOf(id), Field.Store.YES));
|
doc.add(newStringField("id", String.valueOf(id), Field.Store.YES));
|
||||||
doc.add(newStringField("value", String.valueOf(value), Field.Store.NO));
|
doc.add(newStringField("value", String.valueOf(value), Field.Store.NO));
|
||||||
|
doc.add(new LongDocValuesField("dv", value));
|
||||||
modifier.updateDocument(new Term("id", String.valueOf(id)), doc);
|
modifier.updateDocument(new Term("id", String.valueOf(id)), doc);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -400,6 +401,7 @@ public class TestIndexWriterDelete extends LuceneTestCase {
|
|||||||
doc.add(newTextField("content", "aaa", Field.Store.NO));
|
doc.add(newTextField("content", "aaa", Field.Store.NO));
|
||||||
doc.add(newStringField("id", String.valueOf(id), Field.Store.YES));
|
doc.add(newStringField("id", String.valueOf(id), Field.Store.YES));
|
||||||
doc.add(newStringField("value", String.valueOf(value), Field.Store.NO));
|
doc.add(newStringField("value", String.valueOf(value), Field.Store.NO));
|
||||||
|
doc.add(new LongDocValuesField("dv", value));
|
||||||
modifier.addDocument(doc);
|
modifier.addDocument(doc);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -438,6 +440,7 @@ public class TestIndexWriterDelete extends LuceneTestCase {
|
|||||||
Document d = new Document();
|
Document d = new Document();
|
||||||
d.add(newStringField("id", Integer.toString(i), Field.Store.YES));
|
d.add(newStringField("id", Integer.toString(i), Field.Store.YES));
|
||||||
d.add(newTextField("content", "aaa " + i, Field.Store.NO));
|
d.add(newTextField("content", "aaa " + i, Field.Store.NO));
|
||||||
|
d.add(new LongDocValuesField("dv", i));
|
||||||
writer.addDocument(d);
|
writer.addDocument(d);
|
||||||
}
|
}
|
||||||
writer.close();
|
writer.close();
|
||||||
@ -516,6 +519,7 @@ public class TestIndexWriterDelete extends LuceneTestCase {
|
|||||||
Document d = new Document();
|
Document d = new Document();
|
||||||
d.add(newStringField("id", Integer.toString(i), Field.Store.YES));
|
d.add(newStringField("id", Integer.toString(i), Field.Store.YES));
|
||||||
d.add(newTextField("content", "bbb " + i, Field.Store.NO));
|
d.add(newTextField("content", "bbb " + i, Field.Store.NO));
|
||||||
|
d.add(new LongDocValuesField("dv", i));
|
||||||
modifier.updateDocument(new Term("id", Integer.toString(docId)), d);
|
modifier.updateDocument(new Term("id", Integer.toString(docId)), d);
|
||||||
} else { // deletes
|
} else { // deletes
|
||||||
modifier.deleteDocuments(new Term("id", Integer.toString(docId)));
|
modifier.deleteDocuments(new Term("id", Integer.toString(docId)));
|
||||||
|
@ -28,6 +28,7 @@ import org.apache.lucene.analysis.MockAnalyzer;
|
|||||||
import org.apache.lucene.document.Document;
|
import org.apache.lucene.document.Document;
|
||||||
import org.apache.lucene.document.Field;
|
import org.apache.lucene.document.Field;
|
||||||
import org.apache.lucene.document.FieldType;
|
import org.apache.lucene.document.FieldType;
|
||||||
|
import org.apache.lucene.document.LongDocValuesField;
|
||||||
import org.apache.lucene.document.TextField;
|
import org.apache.lucene.document.TextField;
|
||||||
import org.apache.lucene.search.DocIdSetIterator;
|
import org.apache.lucene.search.DocIdSetIterator;
|
||||||
import org.apache.lucene.store.AlreadyClosedException;
|
import org.apache.lucene.store.AlreadyClosedException;
|
||||||
@ -46,7 +47,6 @@ import org.apache.lucene.util.LuceneTestCase.Slow;
|
|||||||
/**
|
/**
|
||||||
* MultiThreaded IndexWriter tests
|
* MultiThreaded IndexWriter tests
|
||||||
*/
|
*/
|
||||||
// nocommit: make sure disk full etc tests here test DV2.0
|
|
||||||
@Slow
|
@Slow
|
||||||
public class TestIndexWriterWithThreads extends LuceneTestCase {
|
public class TestIndexWriterWithThreads extends LuceneTestCase {
|
||||||
|
|
||||||
@ -75,6 +75,7 @@ public class TestIndexWriterWithThreads extends LuceneTestCase {
|
|||||||
customType.setStoreTermVectorOffsets(true);
|
customType.setStoreTermVectorOffsets(true);
|
||||||
|
|
||||||
doc.add(newField("field", "aaa bbb ccc ddd eee fff ggg hhh iii jjj", customType));
|
doc.add(newField("field", "aaa bbb ccc ddd eee fff ggg hhh iii jjj", customType));
|
||||||
|
doc.add(new LongDocValuesField("dv", 5));
|
||||||
|
|
||||||
int idUpto = 0;
|
int idUpto = 0;
|
||||||
int fullCount = 0;
|
int fullCount = 0;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user