- java.lang.Object
-
- org.apache.lucene.queries.intervals.IntervalsSource
-
- Direct Known Subclasses:
ConjunctionIntervalsSource
,DifferenceIntervalsSource
,DisjunctionIntervalsSource
,ExtendedIntervalsSource
,FilteredIntervalsSource
,FixedFieldIntervalsSource
,MinimizingConjunctionIntervalsSource
,MinimumShouldMatchIntervalsSource
,MultiTermIntervalsSource
,NoMatchIntervalsSource
,OffsetIntervalsSource
,PayloadFilteredTermIntervalsSource
,RepeatingIntervalsSource
,TermIntervalsSource
public abstract class IntervalsSource extends java.lang.Object
A helper class forIntervalQuery
that provides anIntervalIterator
for a given field and segmentStatic constructor functions for various different sources can be found in the
Intervals
class
-
-
Constructor Summary
Constructors Constructor Description IntervalsSource()
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description abstract boolean
equals(java.lang.Object other)
abstract int
hashCode()
abstract IntervalIterator
intervals(java.lang.String field, LeafReaderContext ctx)
Create anIntervalIterator
exposing the minimum intervals defined by thisIntervalsSource
abstract IntervalMatchesIterator
matches(java.lang.String field, LeafReaderContext ctx, int doc)
Return aMatchesIterator
over the intervals defined by thisIntervalsSource
for a given document and fieldabstract int
minExtent()
Return the minimum possible width of an interval returned by this sourceabstract java.util.Collection<IntervalsSource>
pullUpDisjunctions()
Expert: return the set of disjunctions that make up this IntervalsSourceabstract java.lang.String
toString()
abstract void
visit(java.lang.String field, QueryVisitor visitor)
Expert: visit the tree of sources
-
-
-
Method Detail
-
intervals
public abstract IntervalIterator intervals(java.lang.String field, LeafReaderContext ctx) throws java.io.IOException
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:
java.io.IOException
-
matches
public abstract IntervalMatchesIterator matches(java.lang.String field, LeafReaderContext ctx, int doc) throws java.io.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:
java.io.IOException
-
visit
public abstract void visit(java.lang.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 java.util.Collection<IntervalsSource> pullUpDisjunctions()
Expert: return the set of disjunctions that make up this IntervalsSourceMost implementations can return
Collections.singleton(this)
-
hashCode
public abstract int hashCode()
- Overrides:
hashCode
in classjava.lang.Object
-
equals
public abstract boolean equals(java.lang.Object other)
- Overrides:
equals
in classjava.lang.Object
-
toString
public abstract java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
-