Package org.apache.lucene.index
Class SortedNumericDocValues
java.lang.Object
org.apache.lucene.search.DocIdSetIterator
org.apache.lucene.index.SortedNumericDocValues
- Direct Known Subclasses:
FilterSortedNumericDocValues
A list of per-document numeric values, sorted according to
Long.compare(long, long).-
Field Summary
Fields inherited from class org.apache.lucene.search.DocIdSetIterator
NO_MORE_DOCS -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionabstract booleanadvanceExact(int target) Advance the iterator to exactlytargetand return whethertargethas a value.abstract intRetrieves the number of values for the current document.abstract longIterates to the next value in the current document.voidrangeIntoBitSet(int fromDoc, int toDoc, long minValue, long maxValue, FixedBitSet bitSet, int offset) Fills aFixedBitSetwith the doc IDs in[fromDoc, toDoc)whose sorted numeric values contain at least one value in[minValue, maxValue].Methods inherited from class org.apache.lucene.search.DocIdSetIterator
advance, all, cost, docID, docIDRunEnd, empty, intoBitSet, nextDoc, range, slowAdvance
-
Constructor Details
-
SortedNumericDocValues
protected SortedNumericDocValues()Sole constructor. (For invocation by subclass constructors, typically implicit.)
-
-
Method Details
-
nextValue
Iterates to the next value in the current document. Do not call this more thandocValueCount()times for the document.- Throws:
IOException
-
docValueCount
public abstract int docValueCount()Retrieves the number of values for the current document. This must always be greater than zero. It is illegal to call this method afteradvanceExact(int)returnedfalse. -
rangeIntoBitSet
public void rangeIntoBitSet(int fromDoc, int toDoc, long minValue, long maxValue, FixedBitSet bitSet, int offset) throws IOException Fills aFixedBitSetwith the doc IDs in[fromDoc, toDoc)whose sorted numeric values contain at least one value in[minValue, maxValue].The default implementation falls back to per-doc evaluation via
advanceExact(int),docValueCount(), andnextValue(). Subclasses with random-access storage can override this to avoid per-doc virtual dispatch.Callers should not rely on the final iterator position after this method returns. Implementations may advance through some or all of the requested range.
- Parameters:
fromDoc- first doc ID to evaluate (inclusive)toDoc- last doc ID to evaluate (exclusive)minValue- lower bound of the range (inclusive)maxValue- upper bound of the range (inclusive)bitSet- the bitset to filloffset- subtracted from each doc ID before setting the bit- Throws:
IOException
-
advanceExact
Advance the iterator to exactlytargetand return whethertargethas a value.targetmust be greater than or equal to the currentdoc IDand must be a valid doc ID, ie. ≥ 0 and <maxDoc. After this method returns,DocIdSetIterator.docID()returnstarget.Note: it is illegal to call
DocIdSetIterator.intoBitSet(int, org.apache.lucene.util.FixedBitSet, int)orDocIdSetIterator.docIDRunEnd()when this method returns false.- Throws:
IOException
-