Class Intervals
- java.lang.Object
-
- org.apache.lucene.search.intervals.Intervals
-
public final class Intervals extends Object
Constructor functions forIntervalsSource
types These sources implement minimum-interval algorithms taken from the paper Efficient Optimally Lazy Algorithms for Minimal-Interval Semantics
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static IntervalsSource
containedBy(IntervalsSource small, IntervalsSource big)
Create a contained-byIntervalsSource
Returns intervals from the small query that appear within intervals of the big querystatic IntervalsSource
containing(IntervalsSource big, IntervalsSource small)
Create a containingIntervalsSource
Returns intervals from the big source that contain one or more intervals from the small sourcestatic IntervalsSource
maxwidth(int width, IntervalsSource subSource)
Create anIntervalsSource
that filters a sub-source by the width of its intervalsstatic IntervalsSource
nonOverlapping(IntervalsSource minuend, IntervalsSource subtrahend)
Create a non-overlapping IntervalsSource Returns intervals of the minuend that do not overlap with intervals from the subtrahendstatic IntervalsSource
notContainedBy(IntervalsSource small, IntervalsSource big)
Create a not-contained-byIntervalsSource
Returns intervals from the smallIntervalsSource
that do not appear within intervals from the bigIntervalsSource
.static IntervalsSource
notContaining(IntervalsSource minuend, IntervalsSource subtrahend)
Create a not-containingIntervalsSource
Returns intervals from the minuend that do not contain intervals of the subtrahendstatic IntervalsSource
notWithin(IntervalsSource minuend, int positions, IntervalsSource subtrahend)
Create a not-withinIntervalsSource
Returns intervals of the minuend that do not appear within a set number of positions of intervals from the subtrahend querystatic IntervalsSource
or(IntervalsSource... subSources)
Return anIntervalsSource
over the disjunction of a set of sub-sourcesstatic IntervalsSource
ordered(IntervalsSource... subSources)
Create an orderedIntervalsSource
Returns intervals in which the subsources all appear in the given orderstatic IntervalsSource
phrase(String... terms)
Return anIntervalsSource
exposing intervals for a phrase consisting of a list of termsstatic IntervalsSource
phrase(IntervalsSource... subSources)
Return anIntervalsSource
exposing intervals for a phrase consisting of a list of IntervalsSourcesstatic IntervalsSource
term(String term)
Return anIntervalsSource
exposing intervals for a termstatic IntervalsSource
term(BytesRef term)
Return anIntervalsSource
exposing intervals for a termstatic IntervalsSource
unordered(boolean allowOverlaps, IntervalsSource... subSources)
Create an unorderedIntervalsSource
Returns intervals in which all the subsources appear.static IntervalsSource
unordered(IntervalsSource... subSources)
Create an unorderedIntervalsSource
Returns intervals in which all the subsources appear.
-
-
-
Method Detail
-
term
public static IntervalsSource term(BytesRef term)
Return anIntervalsSource
exposing intervals for a term
-
term
public static IntervalsSource term(String term)
Return anIntervalsSource
exposing intervals for a term
-
phrase
public static IntervalsSource phrase(String... terms)
Return anIntervalsSource
exposing intervals for a phrase consisting of a list of terms
-
phrase
public static IntervalsSource phrase(IntervalsSource... subSources)
Return anIntervalsSource
exposing intervals for a phrase consisting of a list of IntervalsSources
-
or
public static IntervalsSource or(IntervalsSource... subSources)
Return anIntervalsSource
over the disjunction of a set of sub-sources
-
maxwidth
public static IntervalsSource maxwidth(int width, IntervalsSource subSource)
Create anIntervalsSource
that filters a sub-source by the width of its intervals- Parameters:
width
- the maximum width of intervals in the sub-source ot returnsubSource
- the sub-source to filter
-
ordered
public static IntervalsSource ordered(IntervalsSource... subSources)
Create an orderedIntervalsSource
Returns intervals in which the subsources all appear in the given order- Parameters:
subSources
- an ordered set ofIntervalsSource
objects
-
unordered
public static IntervalsSource unordered(IntervalsSource... subSources)
Create an unorderedIntervalsSource
Returns intervals in which all the subsources appear. The subsources may overlap- Parameters:
subSources
- an unordered set ofIntervalsSource
s
-
unordered
public static IntervalsSource unordered(boolean allowOverlaps, IntervalsSource... subSources)
Create an unorderedIntervalsSource
Returns intervals in which all the subsources appear.- Parameters:
subSources
- an unordered set ofIntervalsSource
sallowOverlaps
- whether or not the sources should be allowed to overlap in a hit
-
nonOverlapping
public static IntervalsSource nonOverlapping(IntervalsSource minuend, IntervalsSource subtrahend)
Create a non-overlapping IntervalsSource Returns intervals of the minuend that do not overlap with intervals from the subtrahend- Parameters:
minuend
- theIntervalsSource
to filtersubtrahend
- theIntervalsSource
to filter by
-
notWithin
public static IntervalsSource notWithin(IntervalsSource minuend, int positions, IntervalsSource subtrahend)
Create a not-withinIntervalsSource
Returns intervals of the minuend that do not appear within a set number of positions of intervals from the subtrahend query- Parameters:
minuend
- theIntervalsSource
to filterpositions
- the maximum distance that intervals from the minuend may occur from intervals of the subtrahendsubtrahend
- theIntervalsSource
to filter by
-
notContaining
public static IntervalsSource notContaining(IntervalsSource minuend, IntervalsSource subtrahend)
Create a not-containingIntervalsSource
Returns intervals from the minuend that do not contain intervals of the subtrahend- Parameters:
minuend
- theIntervalsSource
to filtersubtrahend
- theIntervalsSource
to filter by
-
containing
public static IntervalsSource containing(IntervalsSource big, IntervalsSource small)
Create a containingIntervalsSource
Returns intervals from the big source that contain one or more intervals from the small source- Parameters:
big
- theIntervalsSource
to filtersmall
- theIntervalsSource
to filter by
-
notContainedBy
public static IntervalsSource notContainedBy(IntervalsSource small, IntervalsSource big)
Create a not-contained-byIntervalsSource
Returns intervals from the smallIntervalsSource
that do not appear within intervals from the bigIntervalsSource
.- Parameters:
small
- theIntervalsSource
to filterbig
- theIntervalsSource
to filter by
-
containedBy
public static IntervalsSource containedBy(IntervalsSource small, IntervalsSource big)
Create a contained-byIntervalsSource
Returns intervals from the small query that appear within intervals of the big query- Parameters:
small
- theIntervalsSource
to filterbig
- theIntervalsSource
to filter by
-
-