LUCENE-2348: force single segment for DuplicateFilterTest, for now

git-svn-id: https://svn.apache.org/repos/asf/lucene/dev/trunk@964720 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Michael McCandless 2010-07-16 09:02:00 +00:00
parent 379bc338b5
commit dba59cd60c
2 changed files with 9 additions and 1 deletions

View File

@ -24,7 +24,6 @@ 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.index.IndexReader; import org.apache.lucene.index.IndexReader;
import org.apache.lucene.index.IndexWriter;
import org.apache.lucene.index.IndexWriterConfig; import org.apache.lucene.index.IndexWriterConfig;
import org.apache.lucene.index.RandomIndexWriter; import org.apache.lucene.index.RandomIndexWriter;
import org.apache.lucene.index.Term; import org.apache.lucene.index.Term;
@ -57,6 +56,11 @@ public class DuplicateFilterTest extends LuceneTestCase {
addDoc(writer, "http://www.bar.com", "Dog uses Lucene", "20050101"); addDoc(writer, "http://www.bar.com", "Dog uses Lucene", "20050101");
addDoc(writer, "http://lucene.apache.org", "Lucene 2.0 out", "20050101"); addDoc(writer, "http://lucene.apache.org", "Lucene 2.0 out", "20050101");
addDoc(writer, "http://lucene.apache.org", "Oops. Lucene 2.1 out", "20050102"); addDoc(writer, "http://lucene.apache.org", "Oops. Lucene 2.1 out", "20050102");
// Until we fix LUCENE-2348, the index must
// have only 1 segment:
writer.optimize();
reader = writer.getReader(); reader = writer.getReader();
writer.close(); writer.close();
searcher =new IndexSearcher(reader); searcher =new IndexSearcher(reader);

View File

@ -108,6 +108,10 @@ public class RandomIndexWriter implements Closeable {
} }
w.close(); w.close();
} }
public void optimize() throws IOException {
w.optimize();
}
class RandomCodecProvider extends CodecProvider { class RandomCodecProvider extends CodecProvider {
final String codec; final String codec;