use of org.apache.lucene.search.Collector in project crate by crate.
the class LuceneOrderedDocCollector method doSearch.
private KeyIterable<ShardId, Row> doSearch(TopFieldCollector topFieldCollector, Float minScore, Query query) throws IOException {
Collector collector = topFieldCollector;
if (minScore != null) {
collector = new MinimumScoreCollector(collector, minScore);
}
collector = new KillableCollector(collector, this::raiseIfKilled);
searcher.search(query, collector);
ScoreDoc[] scoreDocs = topFieldCollector.topDocs().scoreDocs;
if (doDocsScores) {
TopFieldCollector.populateScores(scoreDocs, searcher, query);
}
return scoreDocToIterable(scoreDocs);
}
Aggregations