Example usage for org.apache.lucene.util LSBRadixSorter sort

List of usage examples for org.apache.lucene.util LSBRadixSorter sort

Introduction

In this page you can find the example usage for org.apache.lucene.util LSBRadixSorter sort.

Prototype

public void sort(int numBits, final int[] array, int len) 

Source Link

Document

Sort array[0:len] in place.

Usage

From source file:org.apache.solr.search.DocSetBuilder.java

License:Apache License

public DocSet build(FixedBitSet filter) {
    if (bitSet != null) {
        if (filter != null) {
            bitSet.and(filter);//from  w w w.j a va 2  s .  c  om
        }
        return new BitDocSet(bitSet);
        // TODO - if this set will be cached, should we make it smaller if it's below DocSetUtil.smallSetSize?
    } else {
        LSBRadixSorter sorter = new LSBRadixSorter();
        sorter.sort(PackedInts.bitsRequired(maxDoc - 1), buffer, pos);
        final int l = dedup(buffer, pos, filter);
        assert l <= pos;
        return new SortedIntDocSet(buffer, l); // TODO: have option to not shrink in the future if it will be a temporary set
    }
}