Class IntervalsSource
java.lang.Object
org.apache.lucene.queries.intervals.IntervalsSource
- Direct Known Subclasses:
FilteredIntervalsSource
A helper class for
IntervalQuery that provides an IntervalIterator for a given
field and segment
Static constructor functions for various different sources can be found in the Intervals class
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionabstract booleanabstract 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 intReturn the minimum possible width of an interval returned by this sourceabstract Collection<IntervalsSource> Expert: return the set of disjunctions that make up this IntervalsSourceabstract StringtoString()abstract voidvisit(String field, QueryVisitor visitor) Expert: visit the tree of sources
-
Constructor Details
-
IntervalsSource
public IntervalsSource()
-
-
Method Details
-
intervals
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
Expert: visit the tree of sources -
minExtent
public abstract int minExtent()Return the minimum possible width of an interval returned by this source -
pullUpDisjunctions
Expert: return the set of disjunctions that make up this IntervalsSourceMost implementations can return
Collections.singleton(this) -
hashCode
public abstract int hashCode() -
equals
-
toString
-