Example usage for org.apache.lucene.search BulkScorer score

List of usage examples for org.apache.lucene.search BulkScorer score

Introduction

In this page you can find the example usage for org.apache.lucene.search BulkScorer score.

Prototype

public void score(LeafCollector collector, Bits acceptDocs) throws IOException 

Source Link

Document

Scores and collects all matching documents.

Usage

From source file:com.lucene.MyIndexSearcher.java

License:Apache License

protected void search(List<LeafReaderContext> leaves, Weight weight, Collector collector) throws IOException {
    for (LeafReaderContext ctx : leaves) {
        final LeafCollector leafCollector;
        try {/*from   w ww.j a v  a  2 s  . c o m*/
            leafCollector = collector.getLeafCollector(ctx);
        } catch (CollectionTerminatedException e) {
            continue;
        }
        BulkScorer scorer = weight.bulkScorer(ctx);
        if (scorer != null) {
            try {
                scorer.score(leafCollector, ctx.reader().getLiveDocs());
            } catch (CollectionTerminatedException e) {
            }
        }

    }
}