Class FilteredIntervalsSource
- java.lang.Object
-
- org.apache.lucene.queries.intervals.IntervalsSource
-
- org.apache.lucene.queries.intervals.FilteredIntervalsSource
-
public abstract class FilteredIntervalsSource extends IntervalsSource
An IntervalsSource that filters the intervals from another IntervalsSource
-
-
Field Summary
Fields Modifier and Type Field Description protected IntervalsSource
in
-
Constructor Summary
Constructors Constructor Description FilteredIntervalsSource(String name, IntervalsSource in)
Create a new FilteredIntervalsSource
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected abstract boolean
accept(IntervalIterator it)
boolean
equals(Object o)
int
hashCode()
IntervalIterator
intervals(String field, LeafReaderContext ctx)
Create anIntervalIterator
exposing the minimum intervals defined by thisIntervalsSource
IntervalMatchesIterator
matches(String field, LeafReaderContext ctx, int doc)
Return aMatchesIterator
over the intervals defined by thisIntervalsSource
for a given document and fieldstatic IntervalsSource
maxGaps(IntervalsSource in, int maxGaps)
static IntervalsSource
maxWidth(IntervalsSource in, int maxWidth)
int
minExtent()
Return the minimum possible width of an interval returned by this sourceCollection<IntervalsSource>
pullUpDisjunctions()
Expert: return the set of disjunctions that make up this IntervalsSourceString
toString()
void
visit(String field, QueryVisitor visitor)
Expert: visit the tree of sources
-
-
-
Field Detail
-
in
protected final IntervalsSource in
-
-
Constructor Detail
-
FilteredIntervalsSource
public FilteredIntervalsSource(String name, IntervalsSource in)
Create a new FilteredIntervalsSource- Parameters:
name
- the name of the filterin
- the source to filter
-
-
Method Detail
-
maxGaps
public static IntervalsSource maxGaps(IntervalsSource in, int maxGaps)
-
maxWidth
public static IntervalsSource maxWidth(IntervalsSource in, int maxWidth)
-
accept
protected abstract boolean accept(IntervalIterator it)
- Returns:
false
if the current interval should be filtered out
-
intervals
public IntervalIterator intervals(String field, LeafReaderContext ctx) throws IOException
Description copied from class:IntervalsSource
Create anIntervalIterator
exposing the minimum intervals defined by thisIntervalsSource
Returns
null
if no intervals for this field exist in this segment- Specified by:
intervals
in classIntervalsSource
- Parameters:
field
- the field to read positions fromctx
- the context for which to return the iterator- Throws:
IOException
-
matches
public IntervalMatchesIterator matches(String field, LeafReaderContext ctx, int doc) throws IOException
Description copied from class:IntervalsSource
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- Specified by:
matches
in classIntervalsSource
- Parameters:
field
- the field to read positions fromctx
- the document's contextdoc
- the document to return matches for- Throws:
IOException
-
minExtent
public int minExtent()
Description copied from class:IntervalsSource
Return the minimum possible width of an interval returned by this source- Specified by:
minExtent
in classIntervalsSource
-
pullUpDisjunctions
public Collection<IntervalsSource> pullUpDisjunctions()
Description copied from class:IntervalsSource
Expert: return the set of disjunctions that make up this IntervalsSourceMost implementations can return
Collections.singleton(this)
- Specified by:
pullUpDisjunctions
in classIntervalsSource
-
visit
public void visit(String field, QueryVisitor visitor)
Description copied from class:IntervalsSource
Expert: visit the tree of sources- Specified by:
visit
in classIntervalsSource
-
equals
public boolean equals(Object o)
- Specified by:
equals
in classIntervalsSource
-
hashCode
public int hashCode()
- Specified by:
hashCode
in classIntervalsSource
-
toString
public String toString()
- Specified by:
toString
in classIntervalsSource
-
-