Class IntervalsSource
- java.lang.Object
-
- org.apache.lucene.queries.intervals.IntervalsSource
-
- Direct Known Subclasses:
FilteredIntervalsSource
public abstract class IntervalsSource extends Object
A helper class forIntervalQuerythat provides anIntervalIteratorfor a given field and segmentStatic constructor functions for various different sources can be found in the
Intervalsclass
-
-
Constructor Summary
Constructors Constructor Description IntervalsSource()
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description abstract booleanequals(Object other)abstract inthashCode()abstract IntervalIteratorintervals(String field, LeafReaderContext ctx)Create anIntervalIteratorexposing the minimum intervals defined by thisIntervalsSourceabstract IntervalMatchesIteratormatches(String field, LeafReaderContext ctx, int doc)Return aMatchesIteratorover the intervals defined by thisIntervalsSourcefor a given document and fieldabstract intminExtent()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 IntervalsSourceabstract StringtoString()abstract voidvisit(String field, QueryVisitor visitor)Expert: visit the tree of sources
-
-
-
Method Detail
-
intervals
public abstract IntervalIterator intervals(String field, LeafReaderContext ctx) throws IOException
Create anIntervalIteratorexposing the minimum intervals defined by thisIntervalsSourceReturns
nullif 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 aMatchesIteratorover the intervals defined by thisIntervalsSourcefor a given document and fieldReturns
nullif 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 IntervalsSourceMost implementations can return
Collections.singleton(this)
-
-