Class RepeatingIntervalsSource
java.lang.Object
org.apache.lucene.queries.intervals.IntervalsSource
org.apache.lucene.queries.intervals.RepeatingIntervalsSource
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 specialized IntervalIterator.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 ClassesModifier and TypeClassDescriptionprivate static class
private static class
-
Field Summary
FieldsModifier and TypeFieldDescription(package private) final int
(package private) final IntervalsSource
(package private) String
-
Constructor Summary
ConstructorsModifierConstructorDescriptionprivate
RepeatingIntervalsSource
(IntervalsSource in, int childCount) -
Method Summary
Modifier and TypeMethodDescription(package private) static IntervalsSource
build
(IntervalsSource in, int childCount) boolean
int
hashCode()
intervals
(String field, LeafReaderContext ctx) Create anIntervalIterator
exposing the minimum intervals defined by thisIntervalsSource
matches
(String field, LeafReaderContext ctx, int doc) Return aMatchesIterator
over the intervals defined by thisIntervalsSource
for a given document and fieldint
Return the minimum possible width of an interval returned by this sourceExpert: return the set of disjunctions that make up this IntervalsSourcevoid
toString()
void
visit
(String field, QueryVisitor visitor) Expert: visit the tree of sources
-
Field Details
-
in
-
childCount
final int childCount -
name
String name
-
-
Constructor Details
-
RepeatingIntervalsSource
-
-
Method Details
-
build
-
setName
-
intervals
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
-
visit
Description copied from class:IntervalsSource
Expert: visit the tree of sources- Specified by:
visit
in classIntervalsSource
-
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
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
-
hashCode
public int hashCode()- Specified by:
hashCode
in classIntervalsSource
-
equals
- Specified by:
equals
in classIntervalsSource
-
toString
- Specified by:
toString
in classIntervalsSource
-