Class MatchesUtils


  • public final class MatchesUtils
    extends java.lang.Object
    Contains static functions that aid the implementation of Matches and MatchesIterator interfaces.
    • 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
    • Constructor Detail

      • MatchesUtils

        private MatchesUtils()
    • Method Detail

      • fromSubMatches

        public static Matches fromSubMatches​(java.util.List<Matches> subMatches)
        Amalgamate a collection of Matches into a single object
      • forField

        public static Matches forField​(java.lang.String field,
                                       IOSupplier<MatchesIterator> mis)
                                throws java.io.IOException
        Create a Matches for a single field
        Throws:
        java.io.IOException
      • disjunction

        public static MatchesIterator disjunction​(java.util.List<MatchesIterator> subMatches)
                                           throws java.io.IOException
        Create a MatchesIterator that iterates in order over all matches in a set of subiterators
        Throws:
        java.io.IOException
      • disjunction

        public static MatchesIterator disjunction​(LeafReaderContext context,
                                                  int doc,
                                                  Query query,
                                                  java.lang.String field,
                                                  BytesRefIterator terms)
                                           throws java.io.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:
        java.io.IOException