org.apache.lucene.search.spans

## Class SpanTestUtil

- java.lang.Object
- - org.apache.lucene.search.spans.SpanTestUtil

-     public class SpanTestUtil
      extends Object

  Some utility methods used for testing span queries

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `SpanTestUtil()`

  - ### Method Summary

    All Methods Static Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `static void` | `assertFinished(Spans spans)` Assert that `spans` is exhausted.
    `static void` | `assertNext(Spans spans, int doc, int start, int end)` Assert the next iteration from `spans` is a match from `start` to `end` in `doc`.
    `static SpanQuery` | `spanContainingQuery(SpanQuery big, SpanQuery little)` Makes a new SpanContainingQuery (with additional asserts).
    `static SpanQuery` | `spanFirstQuery(SpanQuery query, int end)` Makes a new SpanFirstQuery (with additional asserts).
    `static SpanQuery` | `spanNearOrderedQuery(int slop, SpanQuery... subqueries)` Makes a new ordered SpanNearQuery (with additional asserts)
    `static SpanQuery` | `spanNearOrderedQuery(String field, int slop, String... terms)` Makes a new ordered SpanNearQuery (with additional asserts) from the provided `terms`
    `static SpanQuery` | `spanNearUnorderedQuery(int slop, SpanQuery... subqueries)` Makes a new unordered SpanNearQuery (with additional asserts)
    `static SpanQuery` | `spanNearUnorderedQuery(String field, int slop, String... terms)` Makes a new unordered SpanNearQuery (with additional asserts) from the provided `terms`
    `static SpanQuery` | `spanNotQuery(SpanQuery include, SpanQuery exclude)` Makes a new SpanNotQuery (with additional asserts).
    `static SpanQuery` | `spanNotQuery(SpanQuery include, SpanQuery exclude, int pre, int post)` Makes a new SpanNotQuery (with additional asserts).
    `static SpanQuery` | `spanOrQuery(SpanQuery... subqueries)` Makes a new SpanOrQuery (with additional asserts).
    `static SpanQuery` | `spanOrQuery(String field, String... terms)` Makes a new SpanOrQuery (with additional asserts) from the provided `terms`.
    `static SpanQuery` | `spanPositionRangeQuery(SpanQuery query, int start, int end)` Makes a new SpanPositionRangeQuery (with additional asserts).
    `static SpanQuery` | `spanQuery(SpanQuery query)` Adds additional asserts to a spanquery.
    `static SpanQuery` | `spanTermQuery(String field, String term)` Makes a new SpanTermQuery (with additional asserts).
    `static SpanQuery` | `spanWithinQuery(SpanQuery big, SpanQuery little)` Makes a new SpanWithinQuery (with additional asserts).

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

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

- - ### Constructor Detail

    - #### SpanTestUtil

          public SpanTestUtil()

  - ### Method Detail

    - #### spanQuery

          public static SpanQuery spanQuery(SpanQuery query)

      Adds additional asserts to a spanquery. Highly recommended if you want tests to actually be debuggable.

    - #### spanTermQuery

          public static SpanQuery spanTermQuery(String field,
                                                String term)

      Makes a new SpanTermQuery (with additional asserts).

    - #### spanOrQuery

          public static SpanQuery spanOrQuery(String field,
                                              String... terms)

      Makes a new SpanOrQuery (with additional asserts) from the provided `terms`.

    - #### spanOrQuery

          public static SpanQuery spanOrQuery(SpanQuery... subqueries)

      Makes a new SpanOrQuery (with additional asserts).

    - #### spanNotQuery

          public static SpanQuery spanNotQuery(SpanQuery include,
                                               SpanQuery exclude)

      Makes a new SpanNotQuery (with additional asserts).

    - #### spanNotQuery

          public static SpanQuery spanNotQuery(SpanQuery include,
                                               SpanQuery exclude,
                                               int pre,
                                               int post)

      Makes a new SpanNotQuery (with additional asserts).

    - #### spanFirstQuery

          public static SpanQuery spanFirstQuery(SpanQuery query,
                                                 int end)

      Makes a new SpanFirstQuery (with additional asserts).

    - #### spanPositionRangeQuery

          public static SpanQuery spanPositionRangeQuery(SpanQuery query,
                                                         int start,
                                                         int end)

      Makes a new SpanPositionRangeQuery (with additional asserts).

    - #### spanContainingQuery

          public static SpanQuery spanContainingQuery(SpanQuery big,
                                                      SpanQuery little)

      Makes a new SpanContainingQuery (with additional asserts).

    - #### spanWithinQuery

          public static SpanQuery spanWithinQuery(SpanQuery big,
                                                  SpanQuery little)

      Makes a new SpanWithinQuery (with additional asserts).

    - #### spanNearOrderedQuery

          public static SpanQuery spanNearOrderedQuery(String field,
                                                       int slop,
                                                       String... terms)

      Makes a new ordered SpanNearQuery (with additional asserts) from the provided `terms`

    - #### spanNearOrderedQuery

          public static SpanQuery spanNearOrderedQuery(int slop,
                                                       SpanQuery... subqueries)

      Makes a new ordered SpanNearQuery (with additional asserts)

    - #### spanNearUnorderedQuery

          public static SpanQuery spanNearUnorderedQuery(String field,
                                                         int slop,
                                                         String... terms)

      Makes a new unordered SpanNearQuery (with additional asserts) from the provided `terms`

    - #### spanNearUnorderedQuery

          public static SpanQuery spanNearUnorderedQuery(int slop,
                                                         SpanQuery... subqueries)

      Makes a new unordered SpanNearQuery (with additional asserts)

    - #### assertNext

          public static void assertNext(Spans spans,
                                        int doc,
                                        int start,
                                        int end)
                                 throws IOException

      Assert the next iteration from `spans` is a match from `start` to `end` in `doc`.
      Throws:
        `IOException`

    - #### assertFinished

          public static void assertFinished(Spans spans)
                                     throws Exception

      Assert that `spans` is exhausted.
      Throws:
        `Exception`

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