- java.lang.Object
-
- org.apache.lucene.search.MatchesUtils
-
public final class MatchesUtils extends java.lang.Object
Contains static functions that aid the implementation ofMatches
andMatchesIterator
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
-
Constructor Summary
Constructors Modifier Constructor Description private
MatchesUtils()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static MatchesIterator
disjunction(java.util.List<MatchesIterator> subMatches)
Create a MatchesIterator that iterates in order over all matches in a set of subiteratorsstatic MatchesIterator
disjunction(LeafReaderContext context, int doc, Query query, java.lang.String field, BytesRefIterator terms)
Create a MatchesIterator that is a disjunction over a list of terms extracted from aBytesRefIterator
.static Matches
forField(java.lang.String field, IOSupplier<MatchesIterator> mis)
Create a Matches for a single fieldstatic Matches
fromSubMatches(java.util.List<Matches> subMatches)
Amalgamate a collection ofMatches
into a single object
-
-
-
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(java.util.List<Matches> subMatches)
Amalgamate a collection ofMatches
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 aBytesRefIterator
.Only terms that have at least one match in the given document will be included
- Throws:
java.io.IOException
-
-