Package org.apache.lucene.search

## Class MatchesUtils

- java.lang.Object
- - org.apache.lucene.search.MatchesUtils

-     public final class MatchesUtils
      extends Object

  Contains static functions that aid the implementation of `Matches` and `MatchesIterator` interfaces.

- - ### Field Summary

    Fields
    Modifier and Type | Field | Description
    --- | --- | ---
    `static Matches` | `MATCH_WITH_NO_TERMS` | Indicates a match with no term positions, for example on a Point or DocValues field, or a field indexed as docs and freqs only

  - ### Method Summary

    All Methods Static Methods Concrete Methods
    Modifier and Type | Method | Description
    --- | --- | ---
    `static MatchesIterator` | `disjunction​(List<MatchesIterator> subMatches)` | Create a MatchesIterator that iterates in order over all matches in a set of subiterators
    `static MatchesIterator` | `disjunction​(LeafReaderContext context, int doc, Query query, String field, BytesRefIterator terms)` | Create a MatchesIterator that is a disjunction over a list of terms extracted from a `BytesRefIterator`.
    `static Matches` | `forField​(String field, IOSupplier<MatchesIterator> mis)` | Create a Matches for a single field
    `static Matches` | `fromSubMatches​(List<Matches> subMatches)` | Amalgamate a collection of `Matches` into a single object

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

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

- - ### Field Detail

    - #### MATCH_WITH_NO_TERMS

          public static final Matches MATCH_WITH_NO_TERMS

      Indicates a match with no term positions, for example on a Point or DocValues field, or a field indexed as docs and freqs only

  - ### Method Detail

    - #### fromSubMatches

          public static Matches fromSubMatches​(List<Matches> subMatches)

      Amalgamate a collection of `Matches` into a single object

    - #### forField

          public static Matches forField​(String field,
                                         IOSupplier<MatchesIterator> mis)
                                  throws IOException

      Create a Matches for a single field
      Throws:
        `IOException`

    - #### disjunction

          public static MatchesIterator disjunction​(List<MatchesIterator> subMatches)
                                             throws IOException

      Create a MatchesIterator that iterates in order over all matches in a set of subiterators
      Throws:
        `IOException`

    - #### disjunction

          public static MatchesIterator disjunction​(LeafReaderContext context,
                                                    int doc,
                                                    Query query,
                                                    String field,
                                                    BytesRefIterator terms)
                                             throws IOException

      Create a MatchesIterator that is a disjunction over a list of terms extracted from a `BytesRefIterator`.

      Only terms that have at least one match in the given document will be included

      Throws:
        `IOException`