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

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

Introduction

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

Prototype

@Override
    public void or(DocIdSetIterator it) throws IOException 

Source Link

Usage

From source file:org.elasticsearch.xpack.core.security.authz.accesscontrol.SecurityIndexSearcherWrapperUnitTests.java

License:Open Source License

private SparseFixedBitSet query(LeafReaderContext leaf, String field, String value) throws IOException {
    SparseFixedBitSet sparseFixedBitSet = new SparseFixedBitSet(leaf.reader().maxDoc());
    TermsEnum tenum = leaf.reader().terms(field).iterator();
    while (tenum.next().utf8ToString().equals(value) == false) {
    }//  w ww  . jav  a2s.  c om
    PostingsEnum penum = tenum.postings(null);
    sparseFixedBitSet.or(penum);
    return sparseFixedBitSet;
}