mirror of https://github.com/apache/lucene.git
test bug: don't randomly wrap IndexReader here
git-svn-id: https://svn.apache.org/repos/asf/lucene/dev/trunk@1676006 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
5493fdd9bb
commit
e51762485c
|
@ -34,6 +34,7 @@ import org.apache.lucene.document.FieldType;
|
|||
import org.apache.lucene.document.StoredField;
|
||||
import org.apache.lucene.document.StringField;
|
||||
import org.apache.lucene.document.TextField;
|
||||
import org.apache.lucene.index.DirectoryReader;
|
||||
import org.apache.lucene.index.IndexOptions;
|
||||
import org.apache.lucene.index.IndexReader;
|
||||
import org.apache.lucene.index.IndexWriterConfig;
|
||||
|
@ -1140,10 +1141,10 @@ public class TestPostingsHighlighter extends LuceneTestCase {
|
|||
doc.add(new StoredField("body", "foo"));
|
||||
iw.addDocument(doc);
|
||||
|
||||
IndexReader ir = iw.getReader();
|
||||
IndexReader ir = DirectoryReader.open(iw.w, true);
|
||||
iw.close();
|
||||
|
||||
IndexSearcher searcher = newSearcher(ir);
|
||||
IndexSearcher searcher = new IndexSearcher(ir);
|
||||
PostingsHighlighter highlighter = new PostingsHighlighter();
|
||||
Query query = new MatchAllDocsQuery();
|
||||
TopDocs topDocs = searcher.search(query, 10, Sort.INDEXORDER);
|
||||
|
|
Loading…
Reference in New Issue