/// <summary> Perform an inplace NOT with the doc ids from a given DocIdSetIterator, /// clearing all the bits for each such doc id. /// These doc ids should be smaller than the maximum size passed to the /// constructor. /// </summary> public virtual void InPlaceNot(DocIdSetIterator disi) { int doc; long size = Size(); while ((doc = disi.NextDoc()) < size) { FastClear(doc); } }
/// <summary> Perform an inplace AND with the doc ids from a given DocIdSetIterator, /// leaving only the bits set for which the doc ids are in common. /// These doc ids should be smaller than the maximum size passed to the /// constructor. /// </summary> public virtual void InPlaceAnd(DocIdSetIterator disi) { int bitSetDoc = NextSetBit(0); int disiDoc; while (bitSetDoc != - 1 && (disiDoc = disi.Advance(bitSetDoc)) != DocIdSetIterator.NO_MORE_DOCS) { Clear(bitSetDoc, disiDoc); bitSetDoc = NextSetBit(disiDoc + 1); } if (bitSetDoc != - 1) { Clear(bitSetDoc, Size()); } }
public ConstantScorer(ConstantScoreQuery enclosingInstance, Similarity similarity, IndexReader reader, Weight w):base(similarity) { InitBlock(enclosingInstance); theScore = w.Value; DocIdSet docIdSet = Enclosing_Instance.internalFilter.GetDocIdSet(reader); if (docIdSet == null) { docIdSetIterator = DocIdSet.EMPTY_DOCIDSET.Iterator(); } else { DocIdSetIterator iter = docIdSet.Iterator(); if (iter == null) { docIdSetIterator = DocIdSet.EMPTY_DOCIDSET.Iterator(); } else { docIdSetIterator = iter; } } }
/// <summary>Construct an OpenBitSetDISI with its bits set /// from the doc ids of the given DocIdSetIterator. /// Also give a maximum size one larger than the largest doc id for which a /// bit may ever be set on this OpenBitSetDISI. /// </summary> public OpenBitSetDISI(DocIdSetIterator disi, int maxSize):base(maxSize) { InPlaceOr(disi); }
/// <summary> Create a SortedVIntList.</summary> /// <param name="docIdSetIterator"> An iterator providing document numbers as a set of integers. /// This DocIdSetIterator is iterated completely when this constructor /// is called and it must provide the integers in non /// decreasing order. /// </param> public SortedVIntList(DocIdSetIterator docIdSetIterator) { SortedVIntListBuilder builder = new SortedVIntListBuilder(this); int doc; while ((doc = docIdSetIterator.NextDoc()) != DocIdSetIterator.NO_MORE_DOCS) { builder.AddInt(doc); } builder.Done(); }