int count = bitset.count();
if (count == 0)
{
final DocIdSet empty = EmptyDocIdSet.getInstance();
return new RandomAccessDocIdSet()
{
@Override
public boolean get(int docId)
{
return false;
}
@Override
public DocIdSetIterator iterator() throws IOException
{
return empty.iterator();
}
};
}
else
{
return new RandomAccessDocIdSet()
{
@Override
public DocIdSetIterator iterator()
{
return new MultiValueOrFacetDocIdSetIterator(dataCache,bitset);