LUCENE-1925: open up IndexSearcher a bit for expert usage

git-svn-id: https://svn.apache.org/repos/asf/lucene/java/trunk@819130 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Michael McCandless 2009-09-26 13:02:48 +00:00
parent c390d49290
commit a5e5dc8794
2 changed files with 42 additions and 2 deletions

View File

@ -1,6 +1,30 @@
Lucene Change Log
$Id$
======================= Trunk (not yet released) =======================
Changes in backwards compatibility policy
Changes in runtime behavior
API Changes
* LUCENE-1925: Make IndexSearcher's subReaders and docStarts members
protected; add expert ctor to directly specify reader, subReaders
and docStarts. (John Wang, Tim Smith via Mike McCandless)
Bug fixes
New features
Optimizations
Documentation
Build
Test Cases
======================= Release 2.9.0 2009-09-23 =======================
Changes in backwards compatibility policy

View File

@ -50,8 +50,11 @@ import org.apache.lucene.util.ReaderUtil;
public class IndexSearcher extends Searcher {
IndexReader reader;
private boolean closeReader;
private IndexReader[] subReaders;
private int[] docStarts;
// NOTE: these members might change in incompatible ways
// in the next release
protected IndexReader[] subReaders;
protected int[] docStarts;
/** Creates a searcher searching the index in the named directory.
* @throws CorruptIndexException if the index is corrupt
@ -106,6 +109,19 @@ public class IndexSearcher extends Searcher {
public IndexSearcher(IndexReader r) {
this(r, false);
}
/** Expert: directly specify the reader, subReaders and
* their docID starts.
*
* <p><b>NOTE:</b> This API is experimental and
* might change in incompatible ways in the next
* release.</font></p> */
public IndexSearcher(IndexReader reader, IndexReader[] subReaders, int[] docStarts) {
this.reader = reader;
this.subReaders = subReaders;
this.docStarts = docStarts;
closeReader = false;
}
private IndexSearcher(IndexReader r, boolean closeReader) {
reader = r;