Example usage for org.apache.lucene.util SparseFixedBitSet set

List of usage examples for org.apache.lucene.util SparseFixedBitSet set

Introduction

In this page you can find the example usage for org.apache.lucene.util SparseFixedBitSet set.

Prototype

public void set(int i) 

Source Link

Document

Set the bit at index i.

Usage

From source file:com.boundlessgeo.elasticsearch.geoheatmap.GeoHeatmapAggregator.java

License:Apache License

@Override
public LeafBucketCollector getLeafCollector(LeafReaderContext ctx, final LeafBucketCollector sub)
        throws IOException {
    if (parentReaderContext == null) {
        parentReaderContext = ctx.parent;
    } else {/*from ww  w.j a  v  a 2  s  .  c  om*/
        assert ctx.parent == parentReaderContext;
    }
    return new LeafBucketCollectorBase(sub, null) {
        @Override
        public void collect(int doc, long bucket) throws IOException {
            SparseFixedBitSet bits = buckets.get(bucket);
            if (bits == null) {
                bits = new SparseFixedBitSet(parentReaderContext.reader().maxDoc());
                buckets.put(bucket, bits);
            }
            bits.set(ctx.docBase + doc);
        }
    };
}