Package org.apache.solr.search
Class BitDocSet
- java.lang.Object
-
- org.apache.solr.search.DocSet
-
- org.apache.solr.search.BitDocSet
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addAllTo(org.apache.lucene.util.FixedBitSet target)
Adds all the docs from this set to the target.DocSet
andNot(DocSet other)
Returns the documents in this set that are not in the other set.int
andNotSize(DocSet other)
Returns the number of documents in this set that are not in the other set.BitDocSet
clone()
boolean
exists(int doc)
Returns true of the doc exists in the set.org.apache.lucene.util.FixedBitSet
getBits()
ABits
that has fast random access (as is generally required of Bits).Collection<org.apache.lucene.util.Accountable>
getChildResources()
protected org.apache.lucene.util.FixedBitSet
getFixedBitSet()
protected org.apache.lucene.util.FixedBitSet
getFixedBitSetClone()
DocSet
intersection(DocSet other)
Returns the intersection of this set with another set.int
intersectionSize(DocSet other)
Returns the number of documents of the intersection of this set with another set.boolean
intersects(DocSet other)
Returns true if these sets have any elements in commonDocIterator
iterator()
Returns an ordered iterator of the documents in the set.org.apache.lucene.search.DocIdSetIterator
iterator(org.apache.lucene.index.LeafReaderContext context)
Returns an ordered iterator of the documents in the set for the specifiedLeafReaderContext
.org.apache.solr.search.DocSetQuery
makeQuery()
Returns a Query matching these documents with a score of 1.long
ramBytesUsed()
int
size()
Returns the number of documents in the set.String
toString()
DocSet
union(DocSet other)
Returns the union of this set with another set.int
unionSize(DocSet other)
Returns the number of documents of the union of this set with another set.
-
-
-
Constructor Detail
-
BitDocSet
public BitDocSet()
-
BitDocSet
public BitDocSet(org.apache.lucene.util.FixedBitSet bits)
Construct a BitDocSet. The capacity of theFixedBitSet
should be at least maxDoc()
-
BitDocSet
public BitDocSet(org.apache.lucene.util.FixedBitSet bits, int size)
Construct a BitDocSet, and provides the number of set bits. The capacity of theFixedBitSet
should be at least maxDoc()
-
-
Method Detail
-
iterator
public DocIterator iterator()
Description copied from class:DocSet
Returns an ordered iterator of the documents in the set. Any scoring information is meaningless.
-
getBits
public org.apache.lucene.util.FixedBitSet getBits()
Description copied from class:DocSet
ABits
that has fast random access (as is generally required of Bits). It may be necessary to do work to build this.
-
getFixedBitSet
protected org.apache.lucene.util.FixedBitSet getFixedBitSet()
- Specified by:
getFixedBitSet
in classDocSet
-
getFixedBitSetClone
protected org.apache.lucene.util.FixedBitSet getFixedBitSetClone()
- Specified by:
getFixedBitSetClone
in classDocSet
-
size
public int size()
Description copied from class:DocSet
Returns the number of documents in the set.
-
exists
public boolean exists(int doc)
Returns true of the doc exists in the set. Should only be called when doc <FixedBitSet.length()
.
-
intersection
public DocSet intersection(DocSet other)
Description copied from class:DocSet
Returns the intersection of this set with another set. Neither set is modified - a new DocSet is created and returned.- Specified by:
intersection
in classDocSet
- Returns:
- a DocSet representing the intersection
-
intersectionSize
public int intersectionSize(DocSet other)
Description copied from class:DocSet
Returns the number of documents of the intersection of this set with another set. May be more efficient than actually creating the intersection and then getting its size.- Specified by:
intersectionSize
in classDocSet
-
intersects
public boolean intersects(DocSet other)
Description copied from class:DocSet
Returns true if these sets have any elements in common- Specified by:
intersects
in classDocSet
-
unionSize
public int unionSize(DocSet other)
Description copied from class:DocSet
Returns the number of documents of the union of this set with another set. May be more efficient than actually creating the union and then getting its size.
-
andNotSize
public int andNotSize(DocSet other)
Description copied from class:DocSet
Returns the number of documents in this set that are not in the other set.- Overrides:
andNotSize
in classDocSet
-
addAllTo
public void addAllTo(org.apache.lucene.util.FixedBitSet target)
Description copied from class:DocSet
Adds all the docs from this set to the target. The target should be sized large enough to accommodate all of the documents before calling this method.
-
andNot
public DocSet andNot(DocSet other)
Description copied from class:DocSet
Returns the documents in this set that are not in the other set. Neither set is modified - a new DocSet is created and returned.
-
union
public DocSet union(DocSet other)
Description copied from class:DocSet
Returns the union of this set with another set. Neither set is modified - a new DocSet is created and returned.
-
iterator
public org.apache.lucene.search.DocIdSetIterator iterator(org.apache.lucene.index.LeafReaderContext context)
Description copied from class:DocSet
Returns an ordered iterator of the documents in the set for the specifiedLeafReaderContext
. NOTE: may return null if there are no matching documents for this leaf.
-
makeQuery
public org.apache.solr.search.DocSetQuery makeQuery()
Description copied from class:DocSet
Returns a Query matching these documents with a score of 1. Note that DocSets do not refer to deleted docs.
-
ramBytesUsed
public long ramBytesUsed()
-
getChildResources
public Collection<org.apache.lucene.util.Accountable> getChildResources()
-
-