Class IntervalsSource
java.lang.Object
org.apache.lucene.queries.intervals.IntervalsSource
- Direct Known Subclasses:
ConjunctionIntervalsSource,DifferenceIntervalsSource,DisjunctionIntervalsSource,ExtendedIntervalsSource,FilteredIntervalsSource,FixedFieldIntervalsSource,MinimumShouldMatchIntervalsSource,MultiTermIntervalsSource,NoMatchIntervalsSource,OffsetIntervalsSource,PayloadFilteredTermIntervalsSource,RepeatingIntervalsSource,TermIntervalsSource
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 thisIntervalsSourceReturnsnullif no intervals for this field exist in this segmentabstract IntervalMatchesIteratormatches(String field, LeafReaderContext ctx, int doc) Return aMatchesIteratorover the intervals defined by thisIntervalsSourcefor a given document and field Returnsnullif no intervals exist in the 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 IntervalsSource Most implementations can returnCollections.singleton(this)abstract 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 thisIntervalsSourceReturnsnullif 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 field Returnsnullif 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 IntervalsSource Most implementations can returnCollections.singleton(this) -
hashCode
public abstract int hashCode() -
equals
-
toString
-