Package org.apache.lucene.monitor
Class CandidateMatcher<T extends QueryMatch>
java.lang.Object
org.apache.lucene.monitor.CandidateMatcher<T>
- Direct Known Subclasses:
ParallelMatcher
,PartitionMatcher
Class used to match candidate queries selected by a Presearcher from a Monitor query index.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final IndexSearcher
The searcher to run candidate queries against -
Constructor Summary
ConstructorsConstructorDescriptionCandidateMatcher
(IndexSearcher searcher) Creates a new CandidateMatcher for the supplied DocumentBatch -
Method Summary
Modifier and TypeMethodDescriptionprotected final void
Record a matchprotected void
copyMatches
(CandidateMatcher<T> other) Copy all matches from another CandidateMatcherprotected void
doFinish()
Called when all monitoring of a batch of documents is completefinal MultiMatchingQueries
<T> finish
(long buildTime, int queryCount) abstract void
Runs the supplied query against this CandidateMatcher's set of documents, storing any resulting match, and recording the query in the presearcher hitsvoid
reportError
(String queryId, Exception e) Called by the Monitor if running a query throws an Exceptionabstract T
If two matches from the same query are found (for example, two branches of a disjunction), combine them.
-
Field Details
-
searcher
The searcher to run candidate queries against
-
-
Constructor Details
-
CandidateMatcher
Creates a new CandidateMatcher for the supplied DocumentBatch- Parameters:
searcher
- the IndexSearcher to run queries against
-
-
Method Details
-
matchQuery
public abstract void matchQuery(String queryId, Query matchQuery, Map<String, String> metadata) throws IOExceptionRuns the supplied query against this CandidateMatcher's set of documents, storing any resulting match, and recording the query in the presearcher hits- Parameters:
queryId
- the query idmatchQuery
- the query to runmetadata
- the query metadata- Throws:
IOException
- on IO errors
-
addMatch
Record a match- Parameters:
match
- a QueryMatch object
-
resolve
If two matches from the same query are found (for example, two branches of a disjunction), combine them.- Parameters:
match1
- the first match foundmatch2
- the second match found- Returns:
- a Match object that combines the two
-
reportError
Called by the Monitor if running a query throws an Exception -
finish
- Returns:
- the matches from this matcher
-
doFinish
protected void doFinish()Called when all monitoring of a batch of documents is complete -
copyMatches
Copy all matches from another CandidateMatcher
-