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
-
Method Summary
Modifier and TypeMethodDescriptionabstract boolean
abstract int
hashCode()
abstract IntervalIterator
intervals
(String field, LeafReaderContext ctx) Create anIntervalIterator
exposing the minimum intervals defined by thisIntervalsSource
abstract IntervalMatchesIterator
matches
(String field, LeafReaderContext ctx, int doc) Return aMatchesIterator
over the intervals defined by thisIntervalsSource
for a given document and fieldabstract int
Return the minimum possible width of an interval returned by this sourceabstract Collection<IntervalsSource>
Expert: return the set of disjunctions that make up this IntervalsSourceabstract String
toString()
abstract void
visit
(String field, QueryVisitor visitor) Expert: visit the tree of sources
-
Constructor Details
-
IntervalsSource
public IntervalsSource()
-
-
Method Details
-
intervals
Create anIntervalIterator
exposing the minimum intervals defined by thisIntervalsSource
Returns
null
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 fieldReturns
null
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
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
-