Class RepeatingIntervalsSource
- java.lang.Object
-
- org.apache.lucene.queries.intervals.IntervalsSource
-
- org.apache.lucene.queries.intervals.RepeatingIntervalsSource
-
class RepeatingIntervalsSource extends IntervalsSource
Generates an iterator that spans repeating instances of a sub-iterator, avoiding minimization. This is useful for repeated terms within an unordered interval, for example, ensuring that multiple iterators do not match on a single term. The generated iterators have a specializedIntervalIterator.width()implementation that sums up the widths of the individual sub-iterators, rather than just returning the full span of the iterator.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description private static classRepeatingIntervalsSource.DuplicateIntervalIteratorprivate static classRepeatingIntervalsSource.DuplicateMatchesIterator
-
Field Summary
Fields Modifier and Type Field Description (package private) intchildCount(package private) IntervalsSourcein(package private) java.lang.Stringname
-
Constructor Summary
Constructors Modifier Constructor Description privateRepeatingIntervalsSource(IntervalsSource in, int childCount)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description (package private) static IntervalsSourcebuild(IntervalsSource in, int childCount)booleanequals(java.lang.Object other)inthashCode()IntervalIteratorintervals(java.lang.String field, LeafReaderContext ctx)Create anIntervalIteratorexposing the minimum intervals defined by thisIntervalsSourceReturnsnullif no intervals for this field exist in this segmentIntervalMatchesIteratormatches(java.lang.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 fieldintminExtent()Return the minimum possible width of an interval returned by this sourcejava.util.Collection<IntervalsSource>pullUpDisjunctions()Expert: return the set of disjunctions that make up this IntervalsSource Most implementations can returnCollections.singleton(this)voidsetName(java.lang.String name)java.lang.StringtoString()voidvisit(java.lang.String field, QueryVisitor visitor)Expert: visit the tree of sources
-
-
-
Field Detail
-
in
final IntervalsSource in
-
childCount
final int childCount
-
name
java.lang.String name
-
-
Constructor Detail
-
RepeatingIntervalsSource
private RepeatingIntervalsSource(IntervalsSource in, int childCount)
-
-
Method Detail
-
build
static IntervalsSource build(IntervalsSource in, int childCount)
-
setName
public void setName(java.lang.String name)
-
intervals
public IntervalIterator intervals(java.lang.String field, LeafReaderContext ctx) throws java.io.IOException
Description copied from class:IntervalsSourceCreate anIntervalIteratorexposing the minimum intervals defined by thisIntervalsSourceReturnsnullif no intervals for this field exist in this segment- Specified by:
intervalsin classIntervalsSource- Parameters:
field- the field to read positions fromctx- the context for which to return the iterator- Throws:
java.io.IOException
-
matches
public IntervalMatchesIterator matches(java.lang.String field, LeafReaderContext ctx, int doc) throws java.io.IOException
Description copied from class:IntervalsSourceReturn aMatchesIteratorover the intervals defined by thisIntervalsSourcefor a given document and field Returnsnullif no intervals exist in the given document and field- Specified by:
matchesin classIntervalsSource- Parameters:
field- the field to read positions fromctx- the document's contextdoc- the document to return matches for- Throws:
java.io.IOException
-
visit
public void visit(java.lang.String field, QueryVisitor visitor)Description copied from class:IntervalsSourceExpert: visit the tree of sources- Specified by:
visitin classIntervalsSource
-
minExtent
public int minExtent()
Description copied from class:IntervalsSourceReturn the minimum possible width of an interval returned by this source- Specified by:
minExtentin classIntervalsSource
-
pullUpDisjunctions
public java.util.Collection<IntervalsSource> pullUpDisjunctions()
Description copied from class:IntervalsSourceExpert: return the set of disjunctions that make up this IntervalsSource Most implementations can returnCollections.singleton(this)- Specified by:
pullUpDisjunctionsin classIntervalsSource
-
hashCode
public int hashCode()
- Specified by:
hashCodein classIntervalsSource
-
equals
public boolean equals(java.lang.Object other)
- Specified by:
equalsin classIntervalsSource
-
toString
public java.lang.String toString()
- Specified by:
toStringin classIntervalsSource
-
-