org.apache.lucene.search.intervals

## Class Intervals

- java.lang.Object
- - org.apache.lucene.search.intervals.Intervals

-     public final class Intervals
      extends Object

  Constructor functions for `IntervalsSource` 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 and Description
    --- | ---
    `static IntervalsSource` | `containedBy(IntervalsSource small, IntervalsSource big)` Create a contained-by `IntervalsSource` Returns intervals from the small query that appear within intervals of the big query
    `static IntervalsSource` | `containing(IntervalsSource big, IntervalsSource small)` Create a containing `IntervalsSource` Returns intervals from the big source that contain one or more intervals from the small source
    `static IntervalsSource` | `maxwidth(int width, IntervalsSource subSource)` Create an `IntervalsSource` that filters a sub-source by the width of its intervals
    `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
    `static IntervalsSource` | `notContainedBy(IntervalsSource small, IntervalsSource big)` Create a not-contained-by `IntervalsSource` Returns intervals from the small `IntervalsSource` that do not appear within intervals from the big `IntervalsSource`.
    `static IntervalsSource` | `notContaining(IntervalsSource minuend, IntervalsSource subtrahend)` Create a not-containing `IntervalsSource` Returns intervals from the minuend that do not contain intervals of the subtrahend
    `static IntervalsSource` | `notWithin(IntervalsSource minuend, int positions, IntervalsSource subtrahend)` Create a not-within `IntervalsSource` Returns intervals of the minuend that do not appear within a set number of positions of intervals from the subtrahend query
    `static IntervalsSource` | `or(IntervalsSource... subSources)` Return an `IntervalsSource` over the disjunction of a set of sub-sources
    `static IntervalsSource` | `ordered(IntervalsSource... subSources)` Create an ordered `IntervalsSource` Returns intervals in which the subsources all appear in the given order
    `static IntervalsSource` | `phrase(IntervalsSource... subSources)` Return an `IntervalsSource` exposing intervals for a phrase consisting of a list of IntervalsSources
    `static IntervalsSource` | `phrase(String... terms)` Return an `IntervalsSource` exposing intervals for a phrase consisting of a list of terms
    `static IntervalsSource` | `term(BytesRef term)` Return an `IntervalsSource` exposing intervals for a term
    `static IntervalsSource` | `term(String term)` Return an `IntervalsSource` exposing intervals for a term
    `static IntervalsSource` | `unordered(boolean allowOverlaps, IntervalsSource... subSources)` Create an unordered `IntervalsSource` Returns intervals in which all the subsources appear.
    `static IntervalsSource` | `unordered(IntervalsSource... subSources)` Create an unordered `IntervalsSource` Returns intervals in which all the subsources appear.

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Method Detail

    - #### term

          public static IntervalsSource term(BytesRef term)

      Return an `IntervalsSource` exposing intervals for a term

    - #### term

          public static IntervalsSource term(String term)

      Return an `IntervalsSource` exposing intervals for a term

    - #### phrase

          public static IntervalsSource phrase(String... terms)

      Return an `IntervalsSource` exposing intervals for a phrase consisting of a list of terms

    - #### phrase

          public static IntervalsSource phrase(IntervalsSource... subSources)

      Return an `IntervalsSource` exposing intervals for a phrase consisting of a list of IntervalsSources

    - #### or

          public static IntervalsSource or(IntervalsSource... subSources)

      Return an `IntervalsSource` over the disjunction of a set of sub-sources

    - #### maxwidth

          public static IntervalsSource maxwidth(int width,
                                                 IntervalsSource subSource)

      Create an `IntervalsSource` that filters a sub-source by the width of its intervals
      Parameters:
        `width` - the maximum width of intervals in the sub-source ot return
        `subSource` - the sub-source to filter

    - #### ordered

          public static IntervalsSource ordered(IntervalsSource... subSources)

      Create an ordered `IntervalsSource` Returns intervals in which the subsources all appear in the given order
      Parameters:
        `subSources` - an ordered set of `IntervalsSource` objects

    - #### unordered

          public static IntervalsSource unordered(IntervalsSource... subSources)

      Create an unordered `IntervalsSource` Returns intervals in which all the subsources appear. The subsources may overlap
      Parameters:
        `subSources` - an unordered set of `IntervalsSource`s

    - #### unordered

          public static IntervalsSource unordered(boolean allowOverlaps,
                                                  IntervalsSource... subSources)

      Create an unordered `IntervalsSource` Returns intervals in which all the subsources appear.
      Parameters:
        `subSources` - an unordered set of `IntervalsSource`s
        `allowOverlaps` - 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` - the `IntervalsSource` to filter
        `subtrahend` - the `IntervalsSource` to filter by

    - #### notWithin

          public static IntervalsSource notWithin(IntervalsSource minuend,
                                                  int positions,
                                                  IntervalsSource subtrahend)

      Create a not-within `IntervalsSource` Returns intervals of the minuend that do not appear within a set number of positions of intervals from the subtrahend query
      Parameters:
        `minuend` - the `IntervalsSource` to filter
        `positions` - the maximum distance that intervals from the minuend may occur from intervals of the subtrahend
        `subtrahend` - the `IntervalsSource` to filter by

    - #### notContaining

          public static IntervalsSource notContaining(IntervalsSource minuend,
                                                      IntervalsSource subtrahend)

      Create a not-containing `IntervalsSource` Returns intervals from the minuend that do not contain intervals of the subtrahend
      Parameters:
        `minuend` - the `IntervalsSource` to filter
        `subtrahend` - the `IntervalsSource` to filter by

    - #### containing

          public static IntervalsSource containing(IntervalsSource big,
                                                   IntervalsSource small)

      Create a containing `IntervalsSource` Returns intervals from the big source that contain one or more intervals from the small source
      Parameters:
        `big` - the `IntervalsSource` to filter
        `small` - the `IntervalsSource` to filter by

    - #### notContainedBy

          public static IntervalsSource notContainedBy(IntervalsSource small,
                                                       IntervalsSource big)

      Create a not-contained-by `IntervalsSource` Returns intervals from the small `IntervalsSource` that do not appear within intervals from the big `IntervalsSource`.
      Parameters:
        `small` - the `IntervalsSource` to filter
        `big` - the `IntervalsSource` to filter by

    - #### containedBy

          public static IntervalsSource containedBy(IntervalsSource small,
                                                    IntervalsSource big)

      Create a contained-by `IntervalsSource` Returns intervals from the small query that appear within intervals of the big query
      Parameters:
        `small` - the `IntervalsSource` to filter
        `big` - the `IntervalsSource` to filter by

Copyright © 2000-2018 Apache Software Foundation. All Rights Reserved.