java.lang.Object
org.elasticsearch.search.query.QueryPhaseCollector
- All Implemented Interfaces:
org.apache.lucene.search.Collector
,TwoPhaseCollector
Top-level collector used in the query phase to perform top hits collection as well as aggs collection.
Inspired by
MultiCollector
but specialized for wrapping two collectors and filtering collected
documents as follows:
- through an optional post_filter
that is applied to the top hits collection
- through an optional min_score
threshold, which is applied to both the top hits as well as aggs.
Supports also terminating the collection after a certain number of documents have been collected (terminate_after
).
When top docs as well as aggs are collected (because both collectors were provided), skipping low scoring hits via
Scorable.setMinCompetitiveScore(float)
is not supported for either of the collectors.-
Method Summary
Modifier and TypeMethodDescriptionvoid
run post-collection phaseorg.apache.lucene.search.LeafCollector
getLeafCollector
(org.apache.lucene.index.LeafReaderContext context) org.apache.lucene.search.ScoreMode
void
setWeight
(org.apache.lucene.search.Weight weight)
-
Method Details
-
setWeight
public void setWeight(org.apache.lucene.search.Weight weight) - Specified by:
setWeight
in interfaceorg.apache.lucene.search.Collector
-
scoreMode
public org.apache.lucene.search.ScoreMode scoreMode()- Specified by:
scoreMode
in interfaceorg.apache.lucene.search.Collector
-
getLeafCollector
public org.apache.lucene.search.LeafCollector getLeafCollector(org.apache.lucene.index.LeafReaderContext context) throws IOException - Specified by:
getLeafCollector
in interfaceorg.apache.lucene.search.Collector
- Throws:
IOException
-
doPostCollection
Description copied from interface:TwoPhaseCollector
run post-collection phase- Specified by:
doPostCollection
in interfaceTwoPhaseCollector
- Throws:
IOException
-