Package org.apache.lucene.search.intervals
Intervals queries
This package contains experimental classes to search over intervals within fieldsIntervalsSource
TheIntervalsSource
class can be used to construct proximity
relationships between terms and intervals. They can be built using static methods
in the Intervals
class
Basic intervals
Intervals.term(String)
— Represents a single termIntervals.phrase(java.lang.String...)
— Represents a phraseIntervals.ordered(org.apache.lucene.search.intervals.IntervalsSource...)
— Represents an interval over an ordered set of terms or intervalsIntervals.unordered(org.apache.lucene.search.intervals.IntervalsSource...)
— Represents an interval over an unordered set of terms or intervalsIntervals.or(org.apache.lucene.search.intervals.IntervalsSource...)
— Represents the disjunction of a set of terms or intervals
Filters
Intervals.maxwidth(int, org.apache.lucene.search.intervals.IntervalsSource)
— Filters out intervals that are larger than a set widthIntervals.containedBy(org.apache.lucene.search.intervals.IntervalsSource, org.apache.lucene.search.intervals.IntervalsSource)
— Returns intervals that are contained by another intervalIntervals.notContainedBy(org.apache.lucene.search.intervals.IntervalsSource, org.apache.lucene.search.intervals.IntervalsSource)
— Returns intervals that are *not* contained by another intervalIntervals.containing(org.apache.lucene.search.intervals.IntervalsSource, org.apache.lucene.search.intervals.IntervalsSource)
— Returns intervals that contain another intervalIntervals.notContaining(org.apache.lucene.search.intervals.IntervalsSource, org.apache.lucene.search.intervals.IntervalsSource)
— Returns intervals that do not contain another intervalIntervals.nonOverlapping(org.apache.lucene.search.intervals.IntervalsSource, org.apache.lucene.search.intervals.IntervalsSource)
— Returns intervals that do not overlap with another intervalIntervals.notWithin(org.apache.lucene.search.intervals.IntervalsSource, int, org.apache.lucene.search.intervals.IntervalsSource)
— Returns intervals that do not appear within a set number of positions of another interval
IntervalQuery
AnIntervalQuery
takes a field name and an IntervalsSource
,
and matches all documents that contain intervals defined by the source in that field.-
Class Summary Class Description IntervalFilter Wraps anIntervalIterator
and passes through those intervals that match theIntervalFilter.accept()
functionIntervalIterator ADocIdSetIterator
that also allows iteration over matching intervals in a document.IntervalQuery A query that retrieves documents containing intervals returned from anIntervalsSource
Static constructor functions for various different sources can be found in theIntervals
classIntervals Constructor functions forIntervalsSource
types These sources implement minimum-interval algorithms taken from the paper Efficient Optimally Lazy Algorithms for Minimal-Interval SemanticsIntervalsSource 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