Class IntervalsSource
- java.lang.Object
-
- org.apache.lucene.search.intervals.IntervalsSource
-
public abstract class IntervalsSource extends Object
A helper class forIntervalQuerythat provides anIntervalIteratorfor a given field and segment Static constructor functions for various different sources can be found in theIntervalsclass
-
-
Constructor Summary
Constructors Constructor Description IntervalsSource()
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description abstract booleanequals(Object other)abstract voidextractTerms(String field, Set<Term> terms)Expert: collectTermobjects from this source, to be used for top-level term scoringabstract inthashCode()abstract IntervalIteratorintervals(String field, LeafReaderContext ctx)Create anIntervalIteratorexposing the minimum intervals defined by thisIntervalsSourceReturnsnullif no intervals for this field exist in this segmentabstract MatchesIteratormatches(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 fieldabstract StringtoString()
-
-
-
Method Detail
-
intervals
public abstract IntervalIterator intervals(String field, LeafReaderContext ctx) throws IOException
Create anIntervalIteratorexposing the minimum intervals defined by thisIntervalsSourceReturnsnullif 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 aMatchesIteratorover the intervals defined by thisIntervalsSourcefor a given document and field Returnsnullif 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: collectTermobjects from this source, to be used for top-level term scoring- Parameters:
field- the field to be scoredterms- aSetwhich terms should be added to
-
-