Index: src/java/org/apache/lucene/search/DocIdSet.java =================================================================== --- src/java/org/apache/lucene/search/DocIdSet.java (revision 738168) +++ src/java/org/apache/lucene/search/DocIdSet.java (working copy) @@ -18,11 +18,17 @@ */ import java.io.IOException; +import org.apache.lucene.util.SortedVIntList; /** * A DocIdSet contains a set of doc ids. Implementing classes must provide * a {@link DocIdSetIterator} to access the set. */ public abstract class DocIdSet { - public abstract DocIdSetIterator iterator() throws IOException; + + /** An empty {@code DocIdSet} instance for easy use (this is currently + * implemented using a {@link SortedVIntList}). */ + public static final DocIdSet EMPTY_DOCIDSET = new SortedVIntList(new int[0]); + + public abstract DocIdSetIterator iterator() throws IOException; }