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 TypeMethodDescriptionvoidrun post-collection phaseorg.apache.lucene.search.LeafCollectorgetLeafCollector(org.apache.lucene.index.LeafReaderContext context) org.apache.lucene.search.ScoreModevoidsetWeight(org.apache.lucene.search.Weight weight)
-
Method Details
-
setWeight
public void setWeight(org.apache.lucene.search.Weight weight) - Specified by:
setWeightin interfaceorg.apache.lucene.search.Collector
-
scoreMode
public org.apache.lucene.search.ScoreMode scoreMode()- Specified by:
scoreModein interfaceorg.apache.lucene.search.Collector
-
getLeafCollector
public org.apache.lucene.search.LeafCollector getLeafCollector(org.apache.lucene.index.LeafReaderContext context) throws IOException - Specified by:
getLeafCollectorin interfaceorg.apache.lucene.search.Collector- Throws:
IOException
-
doPostCollection
Description copied from interface:TwoPhaseCollectorrun post-collection phase- Specified by:
doPostCollectionin interfaceTwoPhaseCollector- Throws:
IOException
-