/** * Returns a docset of the collected documents. * * @return a docset of the collected documents */ public DocSet getDocSet() { return new DelegateDocSet(new BitDocSet(bits), scores); }
docBits = ((BitDocSet)docSet).getBits(); } else { docBits = new Bits() {
docBits = ((BitDocSet)docSet).getBits(); } else { docBits = new Bits() {
/** * Creates the document collapse result based on the uncollapsed docset and the collapsed docset. * * @return he document collapse result */ protected DocumentCollapseResult createDocumentCollapseResult() { long startTime = System.currentTimeMillis(); DocSet result = (docbufBitSet != null) ? new BitDocSet(docbufBitSet) : new HashDocSet(docbuf, 0, docbufSize); timeCreateDocSet = System.currentTimeMillis() - startTime; debugDocSetInfo = result.getClass().getSimpleName() + "(" + docbufSize + ")"; return new DocumentCollapseResult(result, uncollapsedDocSet); }
/** * Converts a filter into a DocSet. * This method is not cache-aware and no caches are checked. */ public DocSet convertFilter(Filter lfilter) throws IOException { BitSet bs = lfilter.bits(this.reader); OpenBitSet obs = new OpenBitSet(bs.size()); for(int i=bs.nextSetBit(0); i>=0; i=bs.nextSetBit(i+1)) { obs.fastSet(i); } return new BitDocSet(obs); }
public DocSet getDocSet() { if (pos<=scratch.length) { // assumes docs were collected in sorted order! return new SortedIntDocSet(scratch, pos); } else { // set the bits for ids that were collected in the array for (int i=0; i<scratch.length; i++) bits.fastSet(scratch[i]); return new BitDocSet(bits,pos); } }
public DocSet getDocSet() { if (pos<=scratch.length) { // assumes docs were collected in sorted order! return new SortedIntDocSet(scratch, pos); } else { // set the bits for ids that were collected in the array for (int i=0; i<scratch.length; i++) bits.fastSet(scratch[i]); return new BitDocSet(bits,pos); } }
public DocSet andNot(DocSet other) { OpenBitSet newbits = (OpenBitSet)(this.getBits().clone()); newbits.andNot(other.getBits()); return new BitDocSet(newbits); }
public DocSet union(DocSet other) { OpenBitSet newbits = (OpenBitSet)(this.getBits().clone()); newbits.or(other.getBits()); return new BitDocSet(newbits); }
public DocSet intersection(DocSet other) { // intersection is overloaded in the smaller DocSets to be more // efficient, so dispatch off of it instead. if (!(other instanceof BitDocSet)) { return other.intersection(this); } // Default... handle with bitsets. OpenBitSet newbits = (OpenBitSet)(this.getBits().clone()); newbits.and(other.getBits()); return new BitDocSet(newbits); }
@Override public DocSet andNot(DocSet other) { OpenBitSet newbits = (OpenBitSet)(bits.clone()); if (other instanceof BitDocSet) { newbits.andNot(((BitDocSet)other).bits); } else { DocIterator iter = other.iterator(); while (iter.hasNext()) newbits.clear(iter.nextDoc()); } return new BitDocSet(newbits); }
@Override public DocSet union(DocSet other) { OpenBitSet newbits = (OpenBitSet)(bits.clone()); if (other instanceof BitDocSet) { newbits.union(((BitDocSet)other).bits); } else { DocIterator iter = other.iterator(); while (iter.hasNext()) newbits.set(iter.nextDoc()); } return new BitDocSet(newbits); }
both2 = searcher.getDocListAndSet(query,new BitDocSet(neg),sort, start, limit); test( both2.docList.size() == 0 ); test( both2.docList.matches() == 0 );