Class IntervalsSource
- java.lang.Object
-
- org.apache.lucene.search.intervals.IntervalsSource
-
public abstract class IntervalsSource extends Object
A helper class forIntervalQuery
that provides anIntervalIterator
for a given field and segment Static constructor functions for various different sources can be found in theIntervals
class
-
-
Constructor Summary
Constructors Constructor Description IntervalsSource()
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description abstract boolean
equals(Object other)
abstract void
extractTerms(String field, Set<Term> terms)
Expert: collectTerm
objects from this source, to be used for top-level term scoringabstract int
hashCode()
abstract IntervalIterator
intervals(String field, LeafReaderContext ctx)
Create anIntervalIterator
exposing the minimum intervals defined by thisIntervalsSource
Returnsnull
if no intervals for this field exist in this segmentabstract MatchesIterator
matches(String field, LeafReaderContext ctx, int doc)
Return aMatchesIterator
over the intervals defined by thisIntervalsSource
for a given document and field Returnsnull
if no intervals exist in the given document and fieldabstract String
toString()
-
-
-
Method Detail
-
intervals
public abstract IntervalIterator intervals(String field, LeafReaderContext ctx) throws IOException
Create anIntervalIterator
exposing the minimum intervals defined by thisIntervalsSource
Returnsnull
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 MatchesIterator matches(String field, LeafReaderContext ctx, int doc) throws IOException
Return aMatchesIterator
over the intervals defined by thisIntervalsSource
for a given document and field Returnsnull
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
-
extractTerms
public abstract void extractTerms(String field, Set<Term> terms)
Expert: collectTerm
objects from this source, to be used for top-level term scoring- Parameters:
field
- the field to be scoredterms
- aSet
which terms should be added to
-
-