Class IntervalsSource
- java.lang.Object
-
- org.apache.lucene.queries.intervals.IntervalsSource
-
- Direct Known Subclasses:
FilteredIntervalsSource
public abstract class IntervalsSource extends Object
A helper class forIntervalQuery
that provides anIntervalIterator
for a given field and segment Static constructor functions for various different sources can be found in theIntervals
class
-
-
Constructor Summary
Constructors Constructor Description IntervalsSource()
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description abstract boolean
equals(Object other)
abstract int
hashCode()
abstract IntervalIterator
intervals(String field, LeafReaderContext ctx)
Create anIntervalIterator
exposing the minimum intervals defined by thisIntervalsSource
Returnsnull
if no intervals for this field exist in this segmentabstract IntervalMatchesIterator
matches(String field, LeafReaderContext ctx, int doc)
Return aMatchesIterator
over the intervals defined by thisIntervalsSource
for a given document and field Returnsnull
if no intervals exist in the given document and fieldabstract int
minExtent()
Return the minimum possible width of an interval returned by this sourceabstract Collection<IntervalsSource>
pullUpDisjunctions()
Expert: return the set of disjunctions that make up this IntervalsSource Most implementations can returnCollections.singleton(this)
abstract String
toString()
abstract void
visit(String field, QueryVisitor visitor)
Expert: visit the tree of sources
-
-
-
Method Detail
-
intervals
public abstract IntervalIterator intervals(String field, LeafReaderContext ctx) throws IOException
Create anIntervalIterator
exposing the minimum intervals defined by thisIntervalsSource
Returnsnull
if no intervals for this field exist in this segment- Parameters:
field
- the field to read positions fromctx
- the context for which to return the iterator- Throws:
IOException
-
matches
public abstract IntervalMatchesIterator matches(String field, LeafReaderContext ctx, int doc) throws IOException
Return aMatchesIterator
over the intervals defined by thisIntervalsSource
for a given document and field Returnsnull
if no intervals exist in the given document and field- Parameters:
field
- the field to read positions fromctx
- the document's contextdoc
- the document to return matches for- Throws:
IOException
-
visit
public abstract void visit(String field, QueryVisitor visitor)
Expert: visit the tree of sources
-
minExtent
public abstract int minExtent()
Return the minimum possible width of an interval returned by this source
-
pullUpDisjunctions
public abstract Collection<IntervalsSource> pullUpDisjunctions()
Expert: return the set of disjunctions that make up this IntervalsSource Most implementations can returnCollections.singleton(this)
-
-