Index: CHANGES.txt =================================================================== --- CHANGES.txt (revision 737499) +++ CHANGES.txt (working copy) @@ -145,6 +145,13 @@ 4. LUCENE-1224: Short circuit FuzzyQuery.rewrite when input token length is small compared to minSimilarity. (Timo Nentwig, Mark Miller) + 5. LUCENE-1316: MatchAllDocsQuery now avoids the synchronized + IndexReader.isDeleted() call per document, by directly accessing + the underlying deleteDocs BitVector. This improves performance + with non-readOnly readers, especially in a multi-threaded + environment. (Todd Feak, Yonik Seeley, Jason Rutherglen via Mike + McCandless) + Documentation Build Index: src/test/org/apache/lucene/search/TestMatchAllDocsQuery.java =================================================================== --- src/test/org/apache/lucene/search/TestMatchAllDocsQuery.java (revision 737499) +++ src/test/org/apache/lucene/search/TestMatchAllDocsQuery.java (working copy) @@ -36,6 +36,7 @@ public void testQuery() throws IOException { RAMDirectory dir = new RAMDirectory(); IndexWriter iw = new IndexWriter(dir, new StandardAnalyzer(), true, IndexWriter.MaxFieldLength.LIMITED); + iw.setMaxBufferedDocs(2); // force multi-segment addDoc("one", iw); addDoc("two", iw); addDoc("three four", iw); Index: src/test/org/apache/lucene/index/TestMultiSegmentReader.java =================================================================== --- src/test/org/apache/lucene/index/TestMultiSegmentReader.java (revision 737499) +++ src/test/org/apache/lucene/index/TestMultiSegmentReader.java (working copy) @@ -149,6 +149,19 @@ mr.close(); } + public void testAllTermDocs() throws IOException { + IndexReader reader = openReader(); + int NUM_DOCS = 2; + TermDocs td = reader.termDocs(null); + for(int i=0;iterm. For each document, the document number, the frequency of - * the term in that document is also provided, for use in search scoring. + * the term in that document is also provided, for use in + * search scoring. If term is null, then all non-deleted + * docs are returned with freq=1. * Thus, this method implements the mapping: *