Example usage for org.apache.lucene.search Weight bulkScorer

List of usage examples for org.apache.lucene.search Weight bulkScorer

Introduction

In this page you can find the example usage for org.apache.lucene.search Weight bulkScorer.

Prototype

public BulkScorer bulkScorer(LeafReaderContext context) throws IOException 

Source Link

Document

Optional method, to return a BulkScorer to score the query and send hits to a Collector .

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  ww  w . j a v a 2 s . co  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) {
            }
        }

    }
}