Package org.apache.lucene.search
Class NamedMatches
java.lang.Object
org.apache.lucene.search.NamedMatches
Utility class to help extract the set of sub queries that have matched from a larger query.
Individual subqueries may be wrapped using wrapQuery(String, Query), and the matching
queries for a particular document can then be pulled from the parent Query's Matches
object by calling findNamedMatches(Matches)
-
Constructor Summary
ConstructorsConstructorDescriptionNamedMatches(String name, Matches in) Wraps aMatchesobject and associates a name with it -
Method Summary
Modifier and TypeMethodDescriptionstatic List<NamedMatches> findNamedMatches(Matches matches) Finds allNamedMatchesin aMatchestreegetMatches(String field) Returns aMatchesIteratorover the matches for a single field, ornullif there are no matches in that field.getName()Returns the name of thisMatchesReturns a collection of Matches that make up this instance; if it is not a composite, then this returns an empty listiterator()static QueryWrap a Query so that it associates a name with itsMatchesMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface java.lang.Iterable
forEach, spliterator
-
Constructor Details
-
NamedMatches
Wraps aMatchesobject and associates a name with it
-
-
Method Details
-
getName
Returns the name of thisMatches -
getMatches
Description copied from interface:MatchesReturns aMatchesIteratorover the matches for a single field, ornullif there are no matches in that field.- Specified by:
getMatchesin interfaceMatches- Throws:
IOException
-
getSubMatches
Description copied from interface:MatchesReturns a collection of Matches that make up this instance; if it is not a composite, then this returns an empty list- Specified by:
getSubMatchesin interfaceMatches
-
iterator
-
wrapQuery
Wrap a Query so that it associates a name with itsMatches -
findNamedMatches
Finds allNamedMatchesin aMatchestree
-