예제 #1
0
		/// <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);
			}
		}
예제 #2
0
		/// <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());
			}
		}
예제 #3
0
			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;
					}
				}
			}
예제 #4
0
		/// <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);
		}
예제 #5
0
		/// <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();
		}